forked from aliyun/ros-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
spark-hadoop-distributed-env-3-ecs.yml
1395 lines (1379 loc) · 52.9 KB
/
spark-hadoop-distributed-env-3-ecs.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:
en: Alibaba Cloud ROS Sample Template:This template shows how to deploy a Hadoop-Spark
environment on 3 ECS instances. One ECS instance plays role of master node, and
the other 2 instances play role of worker node. Step 1 configs the ssh login without
password. Step 2 installs and configs Java env. Step 3 installs and configs hadoop
env. Step 4 installs and configs Spark env. *** WARNING *** Only support CentOS-7.
Maybe stopping firewall is needed. The deploying time mainly depends on the speed
of downloading 4 packages.
zh-cn: 阿里云资源编排示例模板:此模板显示了如何在3个ECS实例上部署Hadoop-Spark环境。一个ECS实例扮演主节点的角色,另外两个实例扮演工作节点的角色。步骤1配置不带密码的ssh登录。步骤2安装并
configs Java env。步骤3安装和配置hadoop env。步骤4安装和配置Spark env。***警告***仅支持CentOS-7,也许需要停止防火墙,部署时间主要取决于下载速度4
包。
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: DefaultVPCTest
MinLength: 2
MaxLength: 128
VpcCidrBlock:
Type: String
Label:
en: VPC Cidrblock
zh-cn: VPC网段
Description:
en: 'The IP address range of the VPC in the CIDR block form. You can use the
following IP address ranges and their subnets: 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16'
zh-cn: 专有网络的网段,可选值:10.0.0.0/8,172.16.0.0/12,192.168.0.0/16。
Default: 192.168.0.0/16
AllowedValues:
- 192.168.0.0/16
- 172.16.0.0/12
- 10.0.0.0/8
VSwitchCidrBlock:
Type: String
Label:
en: VSwitch CidrBlock
zh-cn: VSwitch网段
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: Available Zone ID
zh-cn: 可用区ID
Description:
en: ECS Available Zone ID,<br><b>note: <font color='blue'>Before selecting,
please confirm that the Availability Zone supports the specification of creating
ECS resources</font></b>
zh-cn: ECS可用区ID,<br><b>注: <font color='blue'>选择可用区前请确认该可用区是否支持创建ECS资源的规格</font></b>
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: DefaultECSInstance
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: System Disk Category
zh-cn: 系统盘类型
AssociationProperty: ALIYUN::ECS::Disk::SystemDiskCategory
AssociationPropertyMetadata:
InstanceType: InstanceType
ZoneId: ZoneId
ImageId:
Type: String
Label:
en: Image ID
zh-cn: 镜像ID
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
InstancePassword:
Type: String
Label:
en: Instance Password
zh-cn: 实例密码
Description:
en: The 8-30 long login password of instance, consists of the uppercase, lowercase
letter and number. <br> special characters include()`~!@#$%^&*_-+=|{}[]:;'<>,.?/
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: '[0-9A-Za-z\_\-&:;''<>,=%`~!@#\(\)\$\^\*\+\|\{\}\[\]\.\?\/]+$'
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_HOME 主目录必须是新的
Default: /usr/local/hadoop/hadoop-2.7.7
Slave1Name:
Type: String
Label:
en: 'Slave 1 Name '
zh-cn: 从机1名称
Description:
en: Slave 1 hostname, [2, 128] English or Chinese characters, must start with
a letter or Chinese in size, can contain numbers, '_' or '.', '-'.
zh-cn: 从机1名称,[2,128]英文或中文字符,必须以字母或中文开头,可以包含数字、下划线或“.”、“-”。
Default: slave1.hadoop
Slave2Name:
Type: String
Label:
en: 'Slave 2 Name '
zh-cn: 从机2名称
Description:
en: Slave 2 hostname, [2, 128] English or Chinese characters, must start with
a letter or Chinese in size, can contain numbers, '_' or '.', '-'.
zh-cn: 从机2名称,[2,128]英文或中文字符,必须以字母或中文开头,可以包含数字、下划线或“.”、“-”。
Default: slave2.hadoop
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://downloads.lightbend.com/scala/2.12.1/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: http://d3kbcqa49mib13.cloudfront.net/spark-2.1.0-bin-hadoop2.7.tgz
Resources:
EipSNat:
Type: ALIYUN::VPC::EIP
Properties:
Bandwidth: 5
InternetChargeType: PayByTraffic
Metadata:
ALIYUN::ROS::Designer:
id: e5fa30c2-6f49-4ace-8b84-effd8d5b628f
Vpc:
Type: ALIYUN::ECS::VPC
Properties:
CidrBlock:
Ref: VpcCidrBlock
VpcName:
Ref: VpcName
Metadata:
ALIYUN::ROS::Designer:
id: 4f10d556-72a7-4762-a93f-36b518a6c44a
VSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
ZoneId:
Ref: ZoneId
VpcId:
Ref: Vpc
CidrBlock:
Ref: VSwitchCidrBlock
Metadata:
ALIYUN::ROS::Designer:
id: bad194c8-4a85-4618-adf1-a76c5881b344
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: f6144334-651b-4a22-85d1-6eae70686d62
EIpSnatAssociation:
Type: ALIYUN::VPC::EIPAssociation
Properties:
InstanceId:
Ref: NatGateway
AllocationId:
Ref: EipSNat
DependsOn: NatGateway
Metadata:
ALIYUN::ROS::Designer:
id: 9d47587e-a74a-4261-bf51-25bc3a29dc44
EipForward:
Type: ALIYUN::VPC::EIP
Properties:
Bandwidth: 5
InternetChargeType: PayByTraffic
Metadata:
ALIYUN::ROS::Designer:
id: b1fb2361-2d15-4971-a28f-3ee749877b3c
EIpForwardAssociation:
Type: ALIYUN::VPC::EIPAssociation
Properties:
InstanceId:
Ref: NatGateway
AllocationId:
Ref: EipForward
DependsOn: EIpSnatAssociation
Metadata:
ALIYUN::ROS::Designer:
id: 2cc578c5-3cc0-493e-bbd5-55a54f0a3f39
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: e8136a7d-e0ba-44c3-814e-44aa2ecdffcb
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: e0354db5-0def-49b6-b11d-b00a4e65ad5c
Slave1:
Type: ALIYUN::ECS::Instance
Properties:
VpcId:
Fn::GetAtt:
- Vpc
- VpcId
VSwitchId:
Ref: VSwitch
SecurityGroupId:
Ref: SecurityGroup
ImageId:
Ref: ImageId
InstanceName:
Ref: InstanceName
InstanceType:
Ref: InstanceType
IoOptimized: optimized
Password:
Ref: InstancePassword
SystemDiskCategory:
Ref: SystemDiskCategory
UserData:
Fn::Replace:
- ros-notify:
Fn::GetAtt:
- Slave1ConditionHandle
- CurlCli
- Fn::Join:
- ''
- - "#!/bin/bash \n"
- Slave1Name=
- Ref: Slave1Name
- '
'
- "hostnamectl --static set-hostname \"$Slave1Name\" \n"
- "export HOME=/root \n"
- "export 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 \n"
- "chmod 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" : "Install Spark."}''
'
Metadata:
ALIYUN::ROS::Designer:
id: 6f866550-8639-4d81-85e4-4acca94c8c1c
Slave1ConditionHandle:
Type: ALIYUN::ROS::WaitConditionHandle
Properties: {}
Metadata:
ALIYUN::ROS::Designer:
id: 580e65e2-6a84-4fd1-9058-a9b6245584e1
Slave1WaitCondition:
Type: ALIYUN::ROS::WaitCondition
Properties:
Count: 1
Handle:
Ref: Slave1ConditionHandle
Timeout: 1800
DependsOn: Slave1
Metadata:
ALIYUN::ROS::Designer:
id: 57b8c5a7-c6db-4c54-90ea-c7b5789b1f4e
Slave2:
Type: ALIYUN::ECS::Instance
Properties:
VpcId:
Fn::GetAtt:
- Vpc
- VpcId
VSwitchId:
Ref: VSwitch
SecurityGroupId:
Ref: SecurityGroup
ImageId:
Ref: ImageId
InstanceName:
Ref: InstanceName
InstanceType:
Ref: InstanceType
IoOptimized: optimized
Password:
Ref: InstancePassword
SystemDiskCategory:
Ref: SystemDiskCategory
UserData:
Fn::Replace:
- ros-notify:
Fn::GetAtt:
- Slave2ConditionHandle
- CurlCli
- Fn::Join:
- ''
- - "#!/bin/bash \n"
- Slave2Name=
- Ref: Slave2Name
- '
'
- "hostnamectl --static set-hostname \"$Slave2Name\" \n"
- "export HOME=/root \n"
- "export 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 \n"
- "chmod 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" : "Install Spark."}''
'
Metadata:
ALIYUN::ROS::Designer:
id: 95c8edaf-a4aa-44aa-9933-83ae0e8cc66d
Slave2ConditionHandle:
Type: ALIYUN::ROS::WaitConditionHandle
Properties: {}
Metadata:
ALIYUN::ROS::Designer:
id: 270822b7-91b5-43fd-a005-dc890660c686
Slave2WaitCondition:
Type: ALIYUN::ROS::WaitCondition
Properties:
Count: 1
Handle:
Ref: Slave2ConditionHandle
Timeout: 1800
DependsOn: Slave2
Metadata:
ALIYUN::ROS::Designer:
id: e61496c4-7eb9-4643-bafe-2f56b1e31558
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"
- ipaddr_slave1=
- Fn::GetAtt:
- Slave1
- PrivateIp
- '
'
- ipaddr_slave2=
- Fn::GetAtt:
- Slave2
- PrivateIp
- '
'
- HADOOP_HOME=
- Ref: HadoopHome
- '
'
- SCALA_HOME=
- Ref: ScalaHome
- '
'
- SPARK_HOME=
- Ref: SparkHome
- '
'
- HadoopUrl=
- Ref: HadoopUrl
- '
'
- ScalaUrl=
- Ref: ScalaUrl
- '
'
- SparkUrl=
- Ref: SparkUrl
- '
'
- MasterName=
- Ref: MasterName
- '
'
- Slave1Name=
- Ref: Slave1Name
- '
'
- Slave2Name=
- Ref: Slave2Name
- '
'
- " \n"
- "hostnamectl --static set-hostname \"$MasterName\" \n"
- "export HOME=/root \n"
- "export 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"
- "# rm -f * \n"
- "mv id_rsa bak.id_rsa \n"
- "mv 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 \n chmod 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"
- "scp -r /root/.ssh/bak.* root@$ipaddr_slave1:/root/.ssh/ \n"
- "scp -r /root/.ssh/bak.* root@$ipaddr_slave2:/root/.ssh/ \n"
- "ssh root@$ipaddr_slave1 \"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\" \n"
- "ssh root@$ipaddr_slave2 \"cd /root/.ssh; rm id_rsa; mv bak.id_rsa id_rsa;\
\ rm id_rsa.pub; mv bak.id_rsa.pub id_rsa.pub; rm authorized_keys; cp\
\ id_rsa.pub authorized_keys; chmod 600 authorized_keys; chmod 600 id_rsa;\
\ exit\" \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"
- " \n"
- "echo $ip_addr $MasterName >> /etc/hosts \n"
- "echo $ipaddr_slave1 $Slave1Name >> /etc/hosts \n"
- "echo $ipaddr_slave2 $Slave2Name >> /etc/hosts \n"
- "ssh root@$ipaddr_slave1 \"echo $ip_addr $MasterName >> /etc/hosts;\
\ exit\" \n"
- "ssh root@$ipaddr_slave1 \"echo $ipaddr_slave1 $Slave1Name >> /etc/hosts;\
\ exit\" \n"
- "ssh root@$ipaddr_slave1 \"echo $ipaddr_slave2 $Slave2Name >> /etc/hosts;\
\ exit\" \n"
- "ssh root@$ipaddr_slave2 \"echo $ip_addr $MasterName >> /etc/hosts;\
\ exit\" \n"
- "ssh root@$ipaddr_slave2 \"echo $ipaddr_slave1 $Slave1Name >> /etc/hosts;\
\ exit\" \n"
- "ssh root@$ipaddr_slave2 \"echo $ipaddr_slave2 $Slave2Name >> /etc/hosts;\
\ exit\" \n"
- " \n"
- "cd /root \n"
- "yum -y install aria2 \n"
- "yum -y install java \n"
- "ssh root@$ipaddr_slave1 \"yum -y install java; exit\" \n"
- "ssh root@$ipaddr_slave2 \"yum -y install java; exit\" \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 \n"
- "mkdir -p $HADOOP_HOME/dfs/name \n"
- "mkdir -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"
- "ssh root@$ipaddr_slave1 \"mkdir -p $HADOOP_HOME; echo export HADOOP_HOME=$HADOOP_HOME\
\ >> /etc/profile; echo export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin\
\ >> /etc/profile; source /etc/profile;exit\" \n"
- "ssh root@$ipaddr_slave2 \"mkdir -p $HADOOP_HOME; echo export HADOOP_HOME=$HADOOP_HOME\
\ >> /etc/profile; echo export PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin\
\ >> /etc/profile; source /etc/profile;exit\" \n"
- "scp -r $HADOOP_HOME/* root@$ipaddr_slave1:$HADOOP_HOME \n"
- "scp -r $HADOOP_HOME/* root@$ipaddr_slave2:$HADOOP_HOME \n"
- " \n"
- "cd $HADOOP_HOME/etc/hadoop \n"
- "echo $ipaddr_slave1 > slaves \n"
- "echo $ipaddr_slave2 >> slaves \n"
- " \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"
- " \n"
- "cp $SPARK_HOME/conf/slaves.template $SPARK_HOME/conf/slaves \n"
- "echo $ipaddr_slave1 > $SPARK_HOME/conf/slaves \n"
- "echo $ipaddr_slave2 >> $SPARK_HOME/conf/slaves \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"