-
Notifications
You must be signed in to change notification settings - Fork 35
/
spark-hadoop-ecs-instance-group.yml
1179 lines (1168 loc) · 44.2 KB
/
spark-hadoop-ecs-instance-group.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 此ROS模板部署了基于CentOS-7的Hadoop-Spark集群,配置无密码SSH登录,安装Java、Hadoop和Spark环境。通过ECS实例(1主节点+动态扩展的工作节点组)实现,自动处理网络配置与安全设置,适合大数据处理场景。
en: This ROS template deploys a Hadoop-Spark cluster based on CentOS-7, configuring
passwordless SSH login, and installs Java, Hadoop, and Spark environments. Implemented
through ECS instances (1 master node + a dynamically scalable worker node group),
it automatically handles network configurations and security settings, making
it suitable for big data processing scenarios.
Parameters:
VpcName:
Type: String
Label:
en: VPC Name
zh-cn: VPC 名称
Description:
en: Name of VPC, [2, 128] English or Chinese characters, must start with a letter
or Chinese in size, can contain numbers, '_' or '.', '-'.
zh-cn: VPC 名称,[2,128]英文或中文字符,必须以字母或中文开头,可以包含数字、下划线或“.”、“-”。
ConstraintDescription:
en: '[2, 128] English or Chinese characters'
zh-cn: '[2, 128] 英文或中文字符'
Default: MyVPC
MinLength: 2
MaxLength: 128
VpcCidrBlock:
Type: String
Label:
en: VPC CIDR Block
zh-cn: 专有网络网段
Description:
en: 'The IP address range of the VPC in the CIDR Block form; <br>you can use
the following IP address ranges and their subnets: <br><font color=''green''>[10.0.0.0/8]</font><br><font
color=''green''>[172.16.0.0/12]</font><br><font color=''green''>[192.168.0.0/16]</font>'
zh-cn: VPC的IP地址范围;<br>您可以使用以下IP地址范围及其子网:<br><font color='green'>[10.0.0.0/8]</font><br><font
color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0/16]</font>
Default: 192.168.0.0/16
AllowedValues:
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16
VSwitchCidrBlock:
Type: String
Label:
en: VSwitch CIDR Block
zh-cn: 交换机网段
Description:
en: CIDR Block of created VSwitch,It must belong to itself VPC CIDR Block.
zh-cn: 创建的虚拟交换机的子网,它必须属于自己的VPC网段内
Default: 192.168.1.0/24
ZoneId:
Type: String
Label:
en: ECS Available Zone ID
zh-cn: ECS 可用区ID
Description:
en: ECS Available Zone ID,<a href='https://www.alibabacloud.com/help/doc-detail/123712.html'
target='_blank'><font color='blue'><b> View region and zone info</b><font
color='blue'></a>.
zh-cn: ECS 可用区ID,<a href='https://help.aliyun.com/document_detail/123712.html'
target='_blank'><font color='blue'><b> 查看可用区信息</b><font color='blue'></a>.
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
InstanceName:
Type: String
Label:
en: Instance Name
zh-cn: 实例名称
Description:
en: The name of ECS instance,[2, 128] English or Chinese characters, must start
with a letter or Chinese in size, can contain numbers, '_' or '.', '-'.
zh-cn: ECS实例名称,[2,128]英文或中文字符,必须以字母或中文开头,可以包含数字、下划线或“.”、“-”。
Default: ecsinstance
InstanceType:
Type: String
Label:
en: Instance Type
zh-cn: 实例规格
Description:
en: <font color='blue'><b>1.Before selecting the model please confirm that the
current available zone under the model is in stock, some models need to be
reported in advance</b></font><br><font color='blue'><b>2.List of optional
models</font><br></b></font>[ecs.c5.large <font color='green'>2vCPU 4GiB Intranet
bandwidth1Gbps In-grid sending and receiving packages30MillionPPS</font>]<br></b>[ecs.c5.xlarge
<font color='green'>4vCPU 8GiB Intranet bandwidth1.5Gbps In-grid sending and
receiving packages50MillionPPS</font>]<br></b>[ecs.c5.2xlarge <font color='green'>8vCPU
16GiB Intranet bandwidth2.5Gbps In-grid sending and receiving packages80MillionPPS</font>]
zh-cn: <font color='blue'><b>1.选择机型前请先确认当前可用区下该机型是否有货,部分机型需要提前报备</b></font><br><font
color='blue'><b>2.可选机型列表</font><br></b></font>[ecs.c5.large <font color='green'>2vCPU
4GiB 内网带宽1Gbps 内网收发包30万PPS</font>]<br></b>[ecs.c5.xlarge <font color='green'>4vCPU
8GiB 内网带宽1.5Gbps 内网收发包50万PPS</font>]<br></b>[ecs.c5.2xlarge <font color='green'>8vCPU
16GiB 内网带宽2.5Gbps 内网收发包80万PPS</font>]
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
ZoneId: ZoneId
SystemDiskCategory:
Type: String
Label:
en: Instance System Disk Category
zh-cn: 系统磁盘类别
AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
AssociationPropertyMetadata:
InstanceType: InstanceType
ZoneId: ZoneId
ImageId:
Type: String
Label:
en: Image
zh-cn: 镜像
Description:
en: 'Instance Image ID. see detail: <b><a href=''https://www.alibabacloud.com/help/doc-detail/112977.html''
target=''_blank''><font color=''blue''>Find the mirror</font></a></b>'
zh-cn: 实例镜像,详见:<b><a href='https://help.aliyun.com/document_detail/112977.html'
target='_blank'><font color='blue'>查找镜像</font></a></b>
AssociationProperty: ALIYUN::ECS::Image::ImageId
AssociationPropertyMetadata:
InstanceType: ${InstanceType}
SupportedImageOwnerAlias:
- system
- self
- others
Default: centos_7_04_64_20G_alibase_201701015.vhd
SlaveAmount:
Type: Number
Label:
en: Slave Amount
zh-cn: Slave数量
Description:
en: The minimum of ECS instances, must be less than or equal to the maximum.
zh-cn: ECS实例的最小值必须小于或等于最大值。
ConstraintDescription:
en: An integer within [1, 100]
zh-cn: '[1, 100] 内的整数'
Default: 1
MinValue: 1
MaxValue: 100
InstancePassword:
Type: String
Label:
en: Instance password
zh-cn: 实例密码
Description:
en: The Instance Name,A maximum of 16 characters, consisting of lowercase letters,
Numbers, underscores, letters beginning, letters or Numbers ending.
zh-cn: 长度8-30,必须包含大写字母、小写字母、数字、特殊符号三种;<br>特殊字符包括:()'~!@#$%^&*_-+=|{}[]:;'<>,.?/
ConstraintDescription:
en: 'Length 8-30, must contain upper case letters, lower case letters, Numbers,
special symbols three; special characters include: ()`~!@#$%^&*_-+=|{}[]:;''<>,.?/'
zh-cn: 长度8-30,必须包含大写字母、小写字母、数字、特殊符号三种;特殊字符包括:()`~!@#$%^&*_-+=|{}[]:;' <>,.?/
AllowedPattern: '[a-zA-Z0-9-\(\)\`\~\!@\#\$%\^&\*-+=\|\{\}\[\]\:\;\‘\,\.\?\/]*'
MinLength: '8'
MaxLength: '30'
NoEcho: true
MasterName:
Type: String
Label:
en: Master Name
zh-cn: 主机名
Description:
en: Master hostname, [2, 128] English or Chinese characters, must start with
a letter or Chinese in size, can contain numbers, '_' or '.', '-'.
zh-cn: 主机名,[2,128]英文或中文字符,必须以字母或中文开头,可以包含数字、下划线或“.”、“-”。
Default: master.hadoop
HadoopHome:
Type: String
Label:
en: Hadoop Home
zh-cn: Hadoop主目录
Description:
en: HADOOP_HOME directory should be new.
zh-cn: Hadoop 主目录必须是新的
Default: /usr/local/hadoop/hadoop-2.7.7
HadoopUrl:
Type: String
Label:
en: Hadoop Url
zh-cn: Hadoop网址
Description:
en: The official download path of .tar.gz
zh-cn: .tar.gz的官方下载路径
Default: https://ros-template-resources.oss-cn-beijing.aliyuncs.com/Hadoop/hadoop-2.7.7.tar.gz
ScalaHome:
Type: String
Label:
en: Scala Home
zh-cn: Scala主目录
Description:
en: SCALA_HOME directory should be new.
zh-cn: SCALA_HOME 主目录必须是新的
Default: /usr/local/scala/scala-2.12.1
ScalaUrl:
Type: String
Label:
en: Scala Url
zh-cn: Scala网址
Description:
en: The official download path of .tar.gz
zh-cn: .tar.gz的官方下载路径
Default: https://ros-template-resources.oss-cn-beijing.aliyuncs.com/Hadoop/scala-2.12.1.tgz
SparkHome:
Type: String
Label:
en: Spark Home
zh-cn: Spark主目录
Description:
en: SPARK_HOME directory should be new.
zh-cn: SPARK_HOME 主目录必须是新的
Default: /usr/local/hadoop/spark-2.1.0-bin-hadoop2.7
SparkUrl:
Type: String
Label:
en: Spark Url
zh-cn: Spark网址
Description:
en: The official download path of -bin-hadoopx.x.tgz
zh-cn: -bin-hadoopx.x.tgz的官方下载路径
Default: https://ros-template-resources.oss-cn-beijing.aliyuncs.com/Hadoop/spark-2.1.0-bin-hadoop2.7.tgz
Resources:
EipSNat:
Type: ALIYUN::VPC::EIP
Properties:
Bandwidth: 5
InternetChargeType: PayByTraffic
Metadata:
ALIYUN::ROS::Designer:
id: 47ed5ef5-756e-49e8-b9b0-c50476d0ade7
Vpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock:
Ref: VpcCidrBlock
VpcName:
Ref: VpcName
Metadata:
ALIYUN::ROS::Designer:
id: 17dc558e-14b2-48c5-bbf9-c3be382514fd
VSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: Vpc
CidrBlock:
Ref: VSwitchCidrBlock
DependsOn: Vpc
Metadata:
ALIYUN::ROS::Designer:
id: 2808ca1f-6eb6-4241-8bb5-fdcdbb48cbff
NatGateway:
Type: ALIYUN::VPC::NatGateway
Properties:
VpcId:
Fn::GetAtt:
- Vpc
- VpcId
VSwitchId:
Ref: VSwitch
Description: My NAT Gateway
NatGatewayName: nat_gateway_1
DependsOn: VSwitch
Metadata:
ALIYUN::ROS::Designer:
id: 816941db-07b7-4d77-82cc-46a5ff2a7132
EIpSnatAssociation:
Type: ALIYUN::VPC::EIPAssociation
Properties:
InstanceId:
Ref: NatGateway
AllocationId:
Ref: EipSNat
DependsOn: NatGateway
Metadata:
ALIYUN::ROS::Designer:
id: 060e636a-9215-4fde-b36b-b99721bf8004
EipForward:
Type: ALIYUN::VPC::EIP
Properties:
Bandwidth: 5
InternetChargeType: PayByTraffic
Metadata:
ALIYUN::ROS::Designer:
id: d23c2110-16f2-4bc9-88e2-7e46cc6239a4
EIpForwardAssociation:
Type: ALIYUN::VPC::EIPAssociation
Properties:
InstanceId:
Ref: NatGateway
AllocationId:
Ref: EipForward
DependsOn: EIpSnatAssociation
Metadata:
ALIYUN::ROS::Designer:
id: f0ad4242-68dc-4729-8fee-ceea9a474356
SNatEntry:
Type: ALIYUN::ECS::SNatEntry
Properties:
SNatIp:
Fn::GetAtt:
- EipSNat
- EipAddress
SNatTableId:
Fn::GetAtt:
- NatGateway
- SNatTableId
SourceVSwitchId:
Fn::GetAtt:
- VSwitch
- VSwitchId
DependsOn: EIpSnatAssociation
Metadata:
ALIYUN::ROS::Designer:
id: fdc5d17f-fdae-4179-bc55-2dec40176ab5
SecurityGroup:
Type: ALIYUN::ECS::SecurityGroup
Properties:
VpcId:
Ref: Vpc
SecurityGroupEgress:
- DestCidrIp: 0.0.0.0/0
IpProtocol: all
NicType: internet
PortRange: -1/-1
Priority: 1
SecurityGroupIngress:
- IpProtocol: all
NicType: internet
PortRange: -1/-1
Priority: 1
SourceCidrIp: 0.0.0.0/0
Metadata:
ALIYUN::ROS::Designer:
id: 0ce3477b-9385-4705-9b1a-2ee0998fc39a
SlaveGroup:
Type: ALIYUN::ECS::InstanceGroup
Properties:
VpcId:
Fn::GetAtt:
- Vpc
- VpcId
VSwitchId:
Ref: VSwitch
SecurityGroupId:
Ref: SecurityGroup
ImageId:
Ref: ImageId
InstanceName:
Ref: InstanceName
InstanceType:
Ref: InstanceType
IoOptimized: optimized
MaxAmount:
Ref: SlaveAmount
Password:
Ref: InstancePassword
SystemDiskCategory:
Ref: SystemDiskCategory
UserData:
Fn::Replace:
- ros-notify:
Fn::GetAtt:
- SlaveGroupConditionHandle
- CurlCli
- Fn::Join:
- ''
- - "#!/bin/bash \n"
- "export HOME=/root \nexport HOSTNAME=`hostname` \n"
- "cd /root \n"
- "rm -rf .ssh \n"
- "ssh-keygen -t rsa -P '' -f '/root/.ssh/id_rsa' \n"
- "cd /root/.ssh \n"
- "rm -f * \n"
- "echo '-----BEGIN RSA PRIVATE KEY-----' > id_rsa \n"
- "echo 'MIIEowIBAAKCAQEAzfQ/QHwWB1njU9+Wu3RYi9g+g5rydSpAE0klefTJuZjtcaic'\
\ >> id_rsa \n"
- "echo 'SCeBN5avih8UToZ148+Ef2YzOtoosqluZpoYLCPSpAqr8pmviBJIU3vfu9mnDG9L'\
\ >> id_rsa \n"
- "echo 'oevT6K8w3wCBRCmqu+vc0Tpju/EeCuYK3+8w7e2I6F3+zIYzhhX3qmkocje7ACnV'\
\ >> id_rsa \n"
- "echo 'yh2DB/2m3sogTMc0RT+5y3kJAnC6TOIlGsYjOOkPbEF3Ifn1o4ZjOFOmQlcRJer4'\
\ >> id_rsa \n"
- "echo '1E6rTdXAxS2uDNMFBCf9Xyx7O9J+ELTCAXc4h7AE6WLdQb5Apzv4t1KswCAtRenP'\
\ >> id_rsa \n"
- "echo '1xGcUYY8I/JUT2VvBWtQJennrk9jrPZUFDcmcwIDAQABAoIBAAwzDZQaRYvF7UtI'\
\ >> id_rsa \n"
- "echo 'kTslVyFhe8J76SS7jfQWfxvMPi66OkZjQG6duG+8g0VhNei42j7WSfjp6trvlT2P'\
\ >> id_rsa \n"
- "echo '/7QgKJJkxNNmtmy2Ycljm9kmG0ibSePYq9g5ieHcjr6G3yFUfoKHJBtYpBO74pWu'\
\ >> id_rsa \n"
- "echo 'rrI5DuLpERUCjFc9E8w7fOIhPH4XZ6wk/EmPxHTgxZk+aMvqptyPSbUyiUOvCiZf'\
\ >> id_rsa \n"
- "echo 'MD0ircs9vgtslMVDlz9m6CoiNz6B3Yf6eLRoGGMiGnsQzZHIfnHCMX8i65Jc+TvQ'\
\ >> id_rsa \n"
- "echo 'fLopIHzwBwI55xpcOIBRgYiEAQJhLsSNSFugoxMcwe9RalTGGS21HOQu4b3ZylKM'\
\ >> id_rsa \n"
- "echo '8ofEVKECgYEA/Y4MzN04wAsM1yNuHN+9sdiVLG28LWH3dgpcXqa9gyNsWs9Gf8uf'\
\ >> id_rsa \n"
- "echo 'qbuvQGeKDRXCW93wO1jO+pCYVrkyY3l+KhBKIqmkJT5gFsa8dBUvEBLALiHNg3+o'\
\ >> id_rsa \n"
- "echo 'jR2Vqsemk8kMZA8zfJ3FKcMb1pt4S2GqepqsdC3DgzIIsxufCh7jSzsCgYEAz/Cv'\
\ >> id_rsa \n"
- "echo 'Z7gAdSFC8q6QxFxSyhfZwGA6QW6ZU7rZv9ZdGySvZg+vHbpNVmQ0BAQzJui3Qs9u'\
\ >> id_rsa \n"
- "echo 'XQMpYafXWzKsPzG6ZWvYXTF7fuxlovvG8Qd2A2QnGtGMB9YtQMHVqbsUDwxMjiTn'\
\ >> id_rsa \n"
- "echo 'VBZILkDf+WCwQ98P5UMoumI0goIcNZ+AXhcqrikCgYBkSwLvKfYfqH9Mvfv5Odsr'\
\ >> id_rsa \n"
- "echo '9NKUv1c20FB1BYYh/mxp6eIbTW/CbwXZup6IqCvoHxpBAlna77b3T6iibSDsTgtE'\
\ >> id_rsa \n"
- "echo 'kirw6Q8/mBukBrpWZGa4QeJ4nPBQuncuUmx4H/7Y6CaZkZW5DiMF8OIbEmYT0y7+'\
\ >> id_rsa \n"
- "echo 'zh222r9CLtFYH23aL/uSLwKBgQCS1xyG2eE41aw5RBznDWtJW15iA5If8sJD5ocu'\
\ >> id_rsa \n"
- "echo 'eWp2aImUQS8ghxdmEozI6U5WA7CmdWUyObFXTPc/Z6FLXwqJ5IZ+CRt0neuIFNSA'\
\ >> id_rsa \n"
- "echo 'EQy9iFQ1FBUW06BRQpBns7yOg9jr6BOTxchjIV0I9caDp1nKRIrWU9NQ9iCFnYVA'\
\ >> id_rsa \n"
- "echo '7IsvQQKBgFxgF7UOhwaiMb/ATSuhm2v9kVvRPEO9umdo7YJ9I4L09lYbAtpcnusQ'\
\ >> id_rsa \n"
- "echo 'fIROYL25VeEMgYcQyInc3Fm/sgJdbXQnUy+3QbbCcBCmcLj27LPQyxuu7p9hbPPT'\
\ >> id_rsa \n"
- "echo 'Mxx37OmYvOkSVTQz0T9HfDGvOJgt4t4cXD4T/7ewk62p6jdpSQrt' >> id_rsa\
\ \n"
- "echo '-----END RSA PRIVATE KEY-----' >> id_rsa \n"
- "echo 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDN9D9AfBYHWeNT35a7dFiL2D6DmvJ1KkATSSV59Mm5mO1xqJxIJ4E3lq+KHxROhnXjz4R/ZjM62iiyqW5mmhgsI9KkCqvyma+IEkhTe9+72acMb0uh69PorzDfAIFEKaq769zROmO78R4K5grf7zDt7YjoXf7MhjOGFfeqaShyN7sAKdXKHYMH/abeyiBMxzRFP7nLeQkCcLpM4iUaxiM46Q9sQXch+fWjhmM4U6ZCVxEl6vjUTqtN1cDFLa4M0wUEJ/1fLHs70n4QtMIBdziHsATpYt1BvkCnO/i3UqzAIC1F6c/XEZxRhjwj8lRPZW8Fa1Al6eeuT2Os9lQUNyZz\
\ root@iZ2zee53wf4ndvajz30cdvZ' > id_rsa.pub \n"
- "cp id_rsa.pub authorized_keys \n"
- "chmod 600 authorized_keys \nchmod 600 id_rsa \n"
- "sed -i 's/# StrictHostKeyChecking ask/StrictHostKeyChecking no/'\
\ /etc/ssh/ssh_config \n"
- "sed -i 's/GSSAPIAuthentication yes/GSSAPIAuthentication no/' /etc/ssh/ssh_config\
\ \n"
- "service sshd restart \n"
- 'ros-notify -d ''{"data" : "Config SSH login without password."}''
'
Metadata:
ALIYUN::ROS::Designer:
id: f27e17ee-406f-48ac-8df2-cf94eff78c36
SlaveGroupConditionHandle:
Type: ALIYUN::ROS::WaitConditionHandle
Properties: {}
Metadata:
ALIYUN::ROS::Designer:
id: 3384b83e-2c42-489d-975f-78fddac931d4
SlaveGroupWaitCondition:
Type: ALIYUN::ROS::WaitCondition
Properties:
Count:
Ref: SlaveAmount
Handle:
Ref: SlaveGroupConditionHandle
Timeout: 1800
DependsOn: SlaveGroup
Metadata:
ALIYUN::ROS::Designer:
id: 4bd93315-75b1-4251-8024-bbedde846f57
Master:
Type: ALIYUN::ECS::Instance
Properties:
VpcId:
Fn::GetAtt:
- Vpc
- VpcId
VSwitchId:
Ref: VSwitch
SecurityGroupId:
Ref: SecurityGroup
ImageId:
Ref: ImageId
AllocatePublicIP: false
InstanceName:
Ref: InstanceName
InstanceType:
Ref: InstanceType
IoOptimized: optimized
Password:
Ref: InstancePassword
SystemDiskCategory:
Ref: SystemDiskCategory
UserData:
Fn::Replace:
- ros-notify:
Fn::GetAtt:
- MasterConditionHandle
- CurlCli
- Fn::Join:
- ''
- - "#!/bin/bash \n"
- "# set -e \n"
- ips_slave=
- Fn::Join:
- ','
- Fn::GetAtt:
- SlaveGroup
- PrivateIps
- '
'
- hostnames_slave=
- Fn::Join:
- ','
- Fn::GetAtt:
- SlaveGroup
- HostNames
- '
'
- HADOOP_HOME=
- Ref: HadoopHome
- '
'
- SCALA_HOME=
- Ref: ScalaHome
- '
'
- SPARK_HOME=
- Ref: SparkHome
- '
'
- HadoopUrl=
- Ref: HadoopUrl
- '
'
- ScalaUrl=
- Ref: ScalaUrl
- '
'
- SparkUrl=
- Ref: SparkUrl
- '
'
- MasterName=
- Ref: MasterName
- '
'
- "OLD_IFS=$IFS \nIFS=, \nips=($ips_slave) \nhostnames=($hostnames_slave)\
\ \nIFS=$OLD_IFS \n"
- "hostnamectl --static set-hostname \"$MasterName\" \n"
- "export HOME=/root \nexport HOSTNAME=`hostname` \n"
- "ip_addr=`ifconfig eth0 | awk '/inet /{print $2}'` \n"
- "cd /root \n"
- "rm -rf .ssh \n"
- "ssh-keygen -t rsa -P '' -f '/root/.ssh/id_rsa' \n"
- "cd /root/.ssh \n"
- "mv id_rsa bak.id_rsa \nmv id_rsa.pub bak.id_rsa.pub \n"
- "echo '-----BEGIN RSA PRIVATE KEY-----' > id_rsa \n"
- "echo 'MIIEowIBAAKCAQEAzfQ/QHwWB1njU9+Wu3RYi9g+g5rydSpAE0klefTJuZjtcaic'\
\ >> id_rsa \n"
- "echo 'SCeBN5avih8UToZ148+Ef2YzOtoosqluZpoYLCPSpAqr8pmviBJIU3vfu9mnDG9L'\
\ >> id_rsa \n"
- "echo 'oevT6K8w3wCBRCmqu+vc0Tpju/EeCuYK3+8w7e2I6F3+zIYzhhX3qmkocje7ACnV'\
\ >> id_rsa \n"
- "echo 'yh2DB/2m3sogTMc0RT+5y3kJAnC6TOIlGsYjOOkPbEF3Ifn1o4ZjOFOmQlcRJer4'\
\ >> id_rsa \n"
- "echo '1E6rTdXAxS2uDNMFBCf9Xyx7O9J+ELTCAXc4h7AE6WLdQb5Apzv4t1KswCAtRenP'\
\ >> id_rsa \n"
- "echo '1xGcUYY8I/JUT2VvBWtQJennrk9jrPZUFDcmcwIDAQABAoIBAAwzDZQaRYvF7UtI'\
\ >> id_rsa \n"
- "echo 'kTslVyFhe8J76SS7jfQWfxvMPi66OkZjQG6duG+8g0VhNei42j7WSfjp6trvlT2P'\
\ >> id_rsa \n"
- "echo '/7QgKJJkxNNmtmy2Ycljm9kmG0ibSePYq9g5ieHcjr6G3yFUfoKHJBtYpBO74pWu'\
\ >> id_rsa \n"
- "echo 'rrI5DuLpERUCjFc9E8w7fOIhPH4XZ6wk/EmPxHTgxZk+aMvqptyPSbUyiUOvCiZf'\
\ >> id_rsa \n"
- "echo 'MD0ircs9vgtslMVDlz9m6CoiNz6B3Yf6eLRoGGMiGnsQzZHIfnHCMX8i65Jc+TvQ'\
\ >> id_rsa \n"
- "echo 'fLopIHzwBwI55xpcOIBRgYiEAQJhLsSNSFugoxMcwe9RalTGGS21HOQu4b3ZylKM'\
\ >> id_rsa \n"
- "echo '8ofEVKECgYEA/Y4MzN04wAsM1yNuHN+9sdiVLG28LWH3dgpcXqa9gyNsWs9Gf8uf'\
\ >> id_rsa \n"
- "echo 'qbuvQGeKDRXCW93wO1jO+pCYVrkyY3l+KhBKIqmkJT5gFsa8dBUvEBLALiHNg3+o'\
\ >> id_rsa \n"
- "echo 'jR2Vqsemk8kMZA8zfJ3FKcMb1pt4S2GqepqsdC3DgzIIsxufCh7jSzsCgYEAz/Cv'\
\ >> id_rsa \n"
- "echo 'Z7gAdSFC8q6QxFxSyhfZwGA6QW6ZU7rZv9ZdGySvZg+vHbpNVmQ0BAQzJui3Qs9u'\
\ >> id_rsa \n"
- "echo 'XQMpYafXWzKsPzG6ZWvYXTF7fuxlovvG8Qd2A2QnGtGMB9YtQMHVqbsUDwxMjiTn'\
\ >> id_rsa \n"
- "echo 'VBZILkDf+WCwQ98P5UMoumI0goIcNZ+AXhcqrikCgYBkSwLvKfYfqH9Mvfv5Odsr'\
\ >> id_rsa \n"
- "echo '9NKUv1c20FB1BYYh/mxp6eIbTW/CbwXZup6IqCvoHxpBAlna77b3T6iibSDsTgtE'\
\ >> id_rsa \n"
- "echo 'kirw6Q8/mBukBrpWZGa4QeJ4nPBQuncuUmx4H/7Y6CaZkZW5DiMF8OIbEmYT0y7+'\
\ >> id_rsa \n"
- "echo 'zh222r9CLtFYH23aL/uSLwKBgQCS1xyG2eE41aw5RBznDWtJW15iA5If8sJD5ocu'\
\ >> id_rsa \n"
- "echo 'eWp2aImUQS8ghxdmEozI6U5WA7CmdWUyObFXTPc/Z6FLXwqJ5IZ+CRt0neuIFNSA'\
\ >> id_rsa \n"
- "echo 'EQy9iFQ1FBUW06BRQpBns7yOg9jr6BOTxchjIV0I9caDp1nKRIrWU9NQ9iCFnYVA'\
\ >> id_rsa \n"
- "echo '7IsvQQKBgFxgF7UOhwaiMb/ATSuhm2v9kVvRPEO9umdo7YJ9I4L09lYbAtpcnusQ'\
\ >> id_rsa \n"
- "echo 'fIROYL25VeEMgYcQyInc3Fm/sgJdbXQnUy+3QbbCcBCmcLj27LPQyxuu7p9hbPPT'\
\ >> id_rsa \n"
- "echo 'Mxx37OmYvOkSVTQz0T9HfDGvOJgt4t4cXD4T/7ewk62p6jdpSQrt' >> id_rsa\
\ \n"
- "echo '-----END RSA PRIVATE KEY-----' >> id_rsa \n"
- "echo 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDN9D9AfBYHWeNT35a7dFiL2D6DmvJ1KkATSSV59Mm5mO1xqJxIJ4E3lq+KHxROhnXjz4R/ZjM62iiyqW5mmhgsI9KkCqvyma+IEkhTe9+72acMb0uh69PorzDfAIFEKaq769zROmO78R4K5grf7zDt7YjoXf7MhjOGFfeqaShyN7sAKdXKHYMH/abeyiBMxzRFP7nLeQkCcLpM4iUaxiM46Q9sQXch+fWjhmM4U6ZCVxEl6vjUTqtN1cDFLa4M0wUEJ/1fLHs70n4QtMIBdziHsATpYt1BvkCnO/i3UqzAIC1F6c/XEZxRhjwj8lRPZW8Fa1Al6eeuT2Os9lQUNyZz\
\ root@iZ2zee53wf4ndvajz30cdvZ' > id_rsa.pub \n"
- "cp id_rsa.pub authorized_keys \n"
- "chmod 600 authorized_keys \nchmod 600 id_rsa \n"
- "sed -i 's/# StrictHostKeyChecking ask/StrictHostKeyChecking no/'\
\ /etc/ssh/ssh_config \n"
- "sed -i 's/GSSAPIAuthentication yes/GSSAPIAuthentication no/' /etc/ssh/ssh_config\
\ \n"
- "service sshd restart \n"
- "for ip in ${ips[*]} \ndo \nscp -r /root/.ssh/bak.* root@$ip:/root/.ssh/\
\ \ndone \n"
- "for ip in ${ips[*]} \ndo \nssh root@$ip \"cd /root/.ssh; rm -f id_rsa;\
\ mv bak.id_rsa id_rsa; rm -f id_rsa.pub; mv bak.id_rsa.pub id_rsa.pub;\
\ rm -f authorized_keys; cp id_rsa.pub authorized_keys; chmod 600 authorized_keys;\
\ chmod 600 id_rsa; exit\" \ndone \n"
- "cd /root/.ssh \n rm id_rsa \n mv bak.id_rsa id_rsa \n rm id_rsa.pub\
\ \n mv bak.id_rsa.pub id_rsa.pub \n rm authorized_keys \n cp id_rsa.pub\
\ authorized_keys \n chmod 600 authorized_keys \n chmod 600 id_rsa \n\
\ cd \n"
- "echo $ip_addr $MasterName >> /etc/hosts \n"
- "i=0 \n"
- "for ip in ${ips[*]} \ndo \necho $ip ${hostnames[$i]} >> /etc/hosts\
\ \ni=$[i+1] \ndone \n"
- "for ip in ${ips[*]} \ndo \ni=0 \nssh root@$ip \"echo $ip_addr $MasterName\
\ >> /etc/hosts; exit\" \n"
- "for ip1 in ${ips[*]} \ndo \nssh root@$ip \"echo $ip1 ${hostnames[$i]}\
\ >> /etc/hosts; exit\" \ni=$[i+1] \ndone \n"
- "done \n"
- "cd /root \n"
- "yum -y install aria2 \n"
- "yum -y install java \n"
- "for ip in ${ips[*]} \ndo \nssh root@$ip \"yum -y install java; exit\"\
\ \ndone \n"
- "cd /root \n"
- "aria2c $HadoopUrl \n"
- "mkdir -p $HADOOP_HOME \ntar zxvf hadoop-*.tar.gz -C $HADOOP_HOME \n\
cd $HADOOP_HOME \nmv hadoop-*.*/* ./ \nrmdir hadoop-*.* \n"
- "echo >> /etc/profile \n"
- "echo export HADOOP_HOME=$HADOOP_HOME >> /etc/profile \n"
- "echo export HADOOP_MAPRED_HOME=$HADOOP_HOME >> /etc/profile \n"
- "echo export HADOOP_COMMON_HOME=$HADOOP_HOME >> /etc/profile \n"
- "echo export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native >>\
\ /etc/profile \n"
- "echo export YARN_HOME=$HADOOP_HOME >> /etc/profile \n"
- "echo export HADOOP_HDFS_HOME=$HADOOP_HOME >> /etc/profile \n"
- "echo export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop >> /etc/profile\
\ \n"
- "echo export HADOOP_OPTS=-Djava.library.path=$HADOOP_HOME/lib:$HADOOP_HOME/lib/native\
\ >> /etc/profile \n"
- "echo export PATH=$HADOOP_HOME/bin:$HADOOP_HOME/sbin:$PATH >> /etc/profile\
\ \n"
- "echo export CLASSPATH=.:$CLASSPATH:$HADOOP__HOME/lib >> /etc/profile\
\ \n"
- "source /etc/profile \n"
- " \n"
- "mkdir -p $HADOOP_HOME/tmp \nmkdir -p $HADOOP_HOME/dfs/name \nmkdir\
\ -p $HADOOP_HOME/dfs/data \n"
- "echo >> /etc/profile \n"
- "JAVA_HOME=`find /usr/lib/jvm -name 'java-1.8.0-openjdk-1.8.0*'` \n"
- "echo export JAVA_HOME=$JAVA_HOME/jre >> /etc/profile \n"
- "echo export JRE_HOME=$JAVA_HOME/jre >> /etc/profile \n"
- " \n"
- "cd $HADOOP_HOME/etc/hadoop \n"
- "cp hadoop-env.sh bak.hadoop-env.sh \n"
- "sed -i '/export JAVA_HOME=/{s/^/# /}' hadoop-env.sh \n"
- "sed -i \"/# export JAVA_HOME=/a export JAVA_HOME=$JAVA_HOME\" hadoop-env.sh\
\ \n"
- " \n"
- "cd $HADOOP_HOME/etc/hadoop \n"
- "cp core-site.xml bak.core-site.xml \n"
- "echo '<configuration>' > core-site.xml \n"
- "echo ' <property>' >> core-site.xml \n"
- "echo ' <name>hadoop.tmp.dir</name>' >> core-site.xml \n"
- "echo \" <value>$HADOOP_HOME/tmp</value>\" >> core-site.xml \n"
- "echo ' </property>' >> core-site.xml \n"
- "echo '' >> core-site.xml \n"
- "echo ' <property>' >> core-site.xml \n"
- "echo ' <name>fs.default.name</name>' >> core-site.xml \n"
- "echo \" <value>hdfs://$ip_addr:9000</value>\" >> core-site.xml \n"
- "echo ' </property>' >> core-site.xml \n"
- "echo '</configuration>' >> core-site.xml \n"
- " \n"
- "cd $HADOOP_HOME/etc/hadoop \n"
- "cp hdfs-site.xml bak.hdfs-site.xml \n"
- "echo '<configuration>' > hdfs-site.xml \n"
- "echo ' <property>' >> hdfs-site.xml \n"
- "echo ' <name>dfs.namenode.name.dir</name>' >> hdfs-site.xml \n"
- "echo \" <value>file://$HADOOP_HOME/dfs/name</value>\" >> hdfs-site.xml\
\ \n"
- "echo ' </property>' >> hdfs-site.xml \n"
- "echo '' >> hdfs-site.xml \n"
- "echo ' <property>' >> hdfs-site.xml \n"
- "echo ' <name>dfs.datanode.data.dir</name>' >> hdfs-site.xml \n"
- "echo \" <value>file://$HADOOP_HOME/dfs/data</value>\" >> hdfs-site.xml\
\ \n"
- "echo ' </property>' >> hdfs-site.xml \n"
- "echo '' >> hdfs-site.xml \n"
- "echo ' <property>' >> hdfs-site.xml \n"
- "echo ' <name>dfs.replication</name>' >> hdfs-site.xml \n"
- "echo ' <value>1</value>' >> hdfs-site.xml \n"
- "echo ' </property>' >> hdfs-site.xml \n"
- "echo '' >> hdfs-site.xml \n"
- "echo ' <property>' >> hdfs-site.xml \n"
- "echo ' <name>dfs.nameservices</name>' >> hdfs-site.xml \n"
- "echo ' <value>hadoop-cluster1</value>' >> hdfs-site.xml \n"
- "echo ' </property>' >> hdfs-site.xml \n"
- "echo '' >> hdfs-site.xml \n"
- "echo ' <property>' >> hdfs-site.xml \n"
- "echo ' <name>dfs.namenode.secondary.http-address</name>' >> hdfs-site.xml\
\ \n"
- "echo \" <value>$ip_addr:50090</value>\" >> hdfs-site.xml \n"
- "echo ' </property>' >> hdfs-site.xml \n"
- "echo '' >> hdfs-site.xml \n"
- "echo ' <property>' >> hdfs-site.xml \n"
- "echo ' <name>dfs.webhdfs.enabled</name>' >> hdfs-site.xml \n"
- "echo ' <value>true</value>' >> hdfs-site.xml \n"
- "echo ' </property>' >> hdfs-site.xml \n"
- "echo '</configuration>' >> hdfs-site.xml \n"
- " \n"
- "cd $HADOOP_HOME/etc/hadoop \n"
- "cp mapred-site.xml.template mapred-site.xml \n"
- "echo '<configuration>' > mapred-site.xml \n"
- "echo ' <property>' >> mapred-site.xml \n"
- "echo ' <name>mapreduce.framework.name</name>' >> mapred-site.xml\
\ \n"
- "echo ' <value>yarn</value>' >> mapred-site.xml \n"
- "echo ' <final>true</final>' >> mapred-site.xml \n"
- "echo ' </property>' >> mapred-site.xml \n"
- "echo '' >> mapred-site.xml \n"
- "echo ' <property>' >> mapred-site.xml \n"
- "echo ' <name>mapreduce.jobtracker.http.address</name>' >> mapred-site.xml\
\ \n"
- "echo \" <value>$ip_addr:50030</value>\" >> mapred-site.xml \n"
- "echo ' </property>' >> mapred-site.xml \n"
- "echo '' >> mapred-site.xml \n"
- "echo ' <property>' >> mapred-site.xml \n"
- "echo ' <name>mapreduce.jobhistory.address</name>' >> mapred-site.xml\
\ \n"
- "echo \" <value>$ip_addr:10020</value>\" >> mapred-site.xml \n"
- "echo ' </property>' >> mapred-site.xml \n"
- "echo '' >> mapred-site.xml \n"
- "echo ' <property>' >> mapred-site.xml \n"
- "echo ' <name>mapreduce.jobhistory.webapp.address</name>' >> mapred-site.xml\
\ \n"
- "echo \" <value>$ip_addr:19888</value>\" >> mapred-site.xml \n"
- "echo ' </property>' >> mapred-site.xml \n"
- "echo '' >> mapred-site.xml \n"
- "echo ' <property>' >> mapred-site.xml \n"
- "echo ' <name>mapred.job.tracker</name>' >> mapred-site.xml \n"
- "echo \" <value>http://$ip_addr:9001</value>\" >> mapred-site.xml\
\ \n"
- "echo ' </property>' >> mapred-site.xml \n"
- "echo '</configuration>' >> mapred-site.xml \n"
- " \n"
- "cd $HADOOP_HOME/etc/hadoop \n"
- "cp yarn-site.xml bak.yarn-site.xml \n"
- "echo '<configuration>' > yarn-site.xml \n"
- "echo ' <property>' >> yarn-site.xml \n"
- "echo ' <name>yarn.resourcemanager.hostname</name>' >> yarn-site.xml\
\ \n"
- "echo \" <value>$ip_addr</value>\" >> yarn-site.xml \n"
- "echo ' </property>' >> yarn-site.xml \n"
- "echo ' <property>' >> yarn-site.xml \n"
- "echo ' <name>yarn.nodemanager.aux-services</name>' >> yarn-site.xml\
\ \n"
- "echo ' <value>mapreduce_shuffle</value>' >> yarn-site.xml \n"
- "echo ' </property>' >> yarn-site.xml \n"
- "echo ' <property>' >> yarn-site.xml \n"
- "echo ' <name>yarn.resourcemanager.address</name>' >> yarn-site.xml\
\ \n"
- "echo \" <value>$ip_addr:8032</value>\" >> yarn-site.xml \n"
- "echo ' </property>' >> yarn-site.xml \n"
- "echo ' <property>' >> yarn-site.xml \n"
- "echo ' <name>yarn.resourcemanager.scheduler.address</name>' >> yarn-site.xml\
\ \n"
- "echo \" <value>$ip_addr:8030</value>\" >> yarn-site.xml \n"
- "echo ' </property>' >> yarn-site.xml \n"
- "echo ' <property>' >> yarn-site.xml \n"
- "echo ' <name>yarn.resourcemanager.resource-tracker.address</name>'\
\ >> yarn-site.xml \n"
- "echo \" <value>$ip_addr:8031</value>\" >> yarn-site.xml \n"
- "echo ' </property>' >> yarn-site.xml \n"
- "echo ' <property>' >> yarn-site.xml \n"
- "echo ' <name>yarn.resourcemanager.admin.address</name>' >> yarn-site.xml\
\ \n"
- "echo \" <value>$ip_addr:8033</value>\" >> yarn-site.xml \n"
- "echo ' </property>' >> yarn-site.xml \n"
- "echo ' <property>' >> yarn-site.xml \n"
- "echo ' <name>yarn.resourcemanager.webapp.address</name>' >> yarn-site.xml\
\ \n"
- "echo \" <value>$ip_addr:8088</value>\" >> yarn-site.xml \n"
- "echo ' </property>' >> yarn-site.xml \n"
- "echo '</configuration>' >> yarn-site.xml \n"
- " \n"
- "sed -i 304s/'$JAVA'/'java'/ /usr/local/hadoop/hadoop-2.7.7/bin/hdfs\
\ \n"
- "for ip in ${ips[*]} \ndo \nssh root@$ip \"mkdir -p $HADOOP_HOME; exit\"\
\ \ndone \n"
- "for ip in ${ips[*]} \ndo \nscp -r $HADOOP_HOME/* root@$ip:$HADOOP_HOME\
\ \ndone \n"
- " \n"
- "cd $HADOOP_HOME/etc/hadoop \nrm slaves \n"
- "for ip in ${ips[*]} \ndo \necho $ip >> slaves \ndone \n"
- "cd /root \n"
- "aria2c $ScalaUrl \n"
- "mkdir -p $SCALA_HOME \ntar zxvf scala-*.tgz -C $SCALA_HOME \ncd $SCALA_HOME\
\ \nmv scala-*.*/* ./ \nrmdir scala-*.* \n"
- "echo >> /etc/profile \n"
- "echo export SCALA_HOME=$SCALA_HOME >> /etc/profile \n"
- "echo export PATH=$PATH:$SCALA_HOME/bin >> /etc/profile \n"
- "source /etc/profile \n"
- " \n"
- "cd /root \n"
- "aria2c $SparkUrl \n"
- "mkdir -p $SPARK_HOME \ntar zxvf spark-*hadoop*.tgz -C $SPARK_HOME \n\
cd $SPARK_HOME \nmv spark-*hadoop*/* ./ \nrmdir spark-*hadoop* \n"
- "echo >> /etc/profile \n"
- "echo export SPARK_HOME=$SPARK_HOME >> /etc/profile \n"
- "echo export PATH=$PATH:$SPARK_HOME/bin:$SPARK_HOME/sbin >> /etc/profile\
\ \n"
- "source /etc/profile \n"
- "for ip in ${ips[*]} \ndo \necho $ip >> $SPARK_HOME/conf/slaves \ndone\
\ \n"
- "cp $SPARK_HOME/conf/spark-env.sh.template $SPARK_HOME/conf/spark-env.sh\
\ \n"
- "echo export SCALA_HOME=$SCALA_HOME > $SPARK_HOME/conf/spark-env.sh\
\ \n"
- "echo export JAVA_HOME=$JAVA_HOME >> $SPARK_HOME/conf/spark-env.sh\
\ \n"
- "for ip in ${ips[*]} \ndo \nssh root@$ip \"mkdir -p $SCALA_HOME; mkdir\
\ -p $SPARK_HOME; exit\" \ndone \n"
- "for ip in ${ips[*]} \ndo \nscp -r $SCALA_HOME/* root@$ip:$SCALA_HOME\
\ \ndone \n"
- "for ip in ${ips[*]} \ndo \nscp -r $SPARK_HOME/* root@$ip:$SPARK_HOME\
\ \ndone \n"
- "for ip in ${ips[*]} \ndo \nssh root@$ip \"echo >> /etc/profile;echo\
\ export SCALA_HOME=$SCALA_HOME >> /etc/profile;echo export PATH=$PATH:$SCALA_HOME/bin\
\ >> /etc/profile;echo export SPARK_HOME=$SPARK_HOME >> /etc/profile;echo\
\ export PATH=$PATH:$SPARK_HOME/bin:$SPARK_HOME/sbin >> /etc/profile;source\
\ /etc/profile;exit\" \ndone \n"
- "$HADOOP_HOME/bin/hadoop namenode -format \n"
- "systemctl stop firewalld \n"
- "$HADOOP_HOME/sbin/start-dfs.sh \n"
- "$HADOOP_HOME/sbin/start-yarn.sh \n"
- "$SPARK_HOME/sbin/start-all.sh \n"
- 'ros-notify -d ''{"data" : "Install Spark."}''
'
DependsOn:
- SNatEntry
- SlaveGroupWaitCondition
Metadata:
ALIYUN::ROS::Designer:
id: 0fd2725e-6f11-4baa-9a2d-f22871db0155
ForwardEntry:
Type: ALIYUN::ECS::ForwardEntry
Properties:
ExternalIp:
Fn::GetAtt:
- EipForward
- EipAddress
ExternalPort: Any
ForwardTableId:
Fn::GetAtt:
- NatGateway
- ForwardTableId
InternalIp:
Fn::GetAtt:
- Master
- PrivateIp
InternalPort: Any
IpProtocol: Any
DependsOn:
- EIpForwardAssociation
- Master
Metadata:
ALIYUN::ROS::Designer:
id: 2f9ce709-a718-41d6-85ca-a021547c6843
MasterConditionHandle:
Type: ALIYUN::ROS::WaitConditionHandle
Properties: {}
Metadata:
ALIYUN::ROS::Designer:
id: 6bd13808-4875-4f0e-bd53-033213bd9eae
MasterWaitCondition:
Type: ALIYUN::ROS::WaitCondition
Properties:
Count: 1
Handle:
Ref: MasterConditionHandle
Timeout: 10800
DependsOn: Master
Metadata:
ALIYUN::ROS::Designer:
id: 9d890277-5697-4182-8bef-5789c1829068
Outputs:
HadoopWebsiteURL:
Description:
en: URL for newly created Hadoop environment.
zh-cn: 新创建的Hadoop环境的URL。
Value:
Fn::Join:
- ''
- - http://
- Fn::GetAtt:
- EipForward
- EipAddress
- :50070
SparkWebsiteURL:
Description:
en: URL for newly created Spark environment.
zh-cn: 新创建的Spark环境的URL。
Value:
Fn::Join:
- ''
- - http://
- Fn::GetAtt:
- EipForward
- EipAddress
- :8080
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VpcName
- VpcCidrBlock
- VSwitchCidrBlock
Label:
default:
en: VPC
zh-cn: 专有网络
- Parameters:
- ZoneId
- InstanceName
- InstanceType
- SystemDiskCategory
- ImageId
- SlaveAmount
- InstancePassword
Label:
default:
en: ECS
zh-cn: 云服务器
- Parameters:
- MasterName
- HadoopHome
- HadoopUrl
Label:
default: Hadoop
- Parameters:
- ScalaHome
- ScalaUrl
Label:
default: Scala
- Parameters:
- SparkHome
- SparkUrl
Label:
default: Spark
TemplateTags:
- acs:example:大数据:创建基于ECSGroup部署Spark和Hadoop分布式环境
ALIYUN::ROS::Designer:
060e636a-9215-4fde-b36b-b99721bf8004:
position:
x: 249
y: -28
size:
height: 60
width: 60
z: 0
0ce3477b-9385-4705-9b1a-2ee0998fc39a:
position:
x: 327
y: 400
size:
height: 60
width: 60
z: 1
0fd2725e-6f11-4baa-9a2d-f22871db0155:
position:
x: 249
y: 244
size:
height: 60
width: 60
z: 2
1186d278-2787-40da-a161-ec608fd5eb4f:
source:
id: 2f9ce709-a718-41d6-85ca-a021547c6843
target:
id: 0fd2725e-6f11-4baa-9a2d-f22871db0155
z: 1
146ab7cd-89ce-4016-b584-02e26973fcd2:
source:
id: fdc5d17f-fdae-4179-bc55-2dec40176ab5
target:
id: 47ed5ef5-756e-49e8-b9b0-c50476d0ade7