-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate.yml
99 lines (96 loc) · 3.93 KB
/
create.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
- hosts: localhost
connection: local
gather_facts: False
tasks:
- name: Create security group
ec2_group:
name: '{{ hadoop_cluster }}-sg'
description: "Dummy group to allow all communication within {{ hadoop_cluster }} and ssh from all the net"
region: '{{ aws_region }}'
vpc_id: '{{ aws_vpc_id }}'
rules:
- proto: all
group_name: '{{ hadoop_cluster }}-sg'
- proto: tcp
from_port: 22
to_port: 22
cidr_ip: 0.0.0.0/0
tags: [aws_security_group]
- name: Provision master nodes
ec2:
key_name: '{{ aws_key }}'
instance_type: '{{ item.type }}'
region: '{{ aws_region }}'
image: ami-e0c19f83
wait: yes
group: '{{ hadoop_cluster }}-sg'
# placement_group: '{{ aws_placement_group }}'
count: 1
vpc_subnet_id: '{{ aws_subnet }}'
assign_public_ip: yes
instance_tags:
hostname: '{{ item.hostname }}'
tags: '{{ item.tags }}'
ansible_zookeeper_server_id: '{{ item.ansible_zookeeper_server_id }}'
with_items:
- { type: 't2.large', hostname: 'master-1', tags: 'hdp-cluster-1,zookeeper,hdfs-primary,hdfs-namenode,hdfs-journalnode,yarn,yarn-resourcemanager', ansible_zookeeper_server_id: 1 }
- { type: 't2.large', hostname: 'master-2', tags: 'hdp-cluster-1,zookeeper,hdfs-secondary,hdfs-namenode,hdfs-journalnode,mapred,mapred-historyserver,yarn,yarn-resourcemanager', ansible_zookeeper_server_id: 2 }
- { type: 't2.large', hostname: 'master-3', tags: 'hdp-cluster-1,zookeeper,hdfs-journalnode,mapred,yarn,storm-nimbus,tez', ansible_zookeeper_server_id: 3 }
tags: [master-nodes]
- name: Provision datanodes
ec2:
key_name: '{{ aws_key }}'
instance_type: '{{ item.type }}'
region: '{{ aws_region}}'
image: ami-e0c19f83
wait: yes
group: '{{ hadoop_cluster }}-sg'
# placement_group: '{{ aws_placement_group }}'
count: 1
vpc_subnet_id: '{{ aws_subnet }}'
assign_public_ip: yes
instance_tags:
hostname: '{{ item.hostname }}'
tags: '{{ item.tags }}'
with_items:
- { type: 't2.small', hostname: 'datanode-1', tags: 'hdp-cluster-1,hdfs-datanode,mapred,yarn,yarn-nodemanager' }
- { type: 't2.small', hostname: 'datanode-2', tags: 'hdp-cluster-1,hdfs-datanode,mapred,yarn,yarn-nodemanager' }
tags: [datanodes]
- name: Provision kafka brokers
ec2:
key_name: '{{ aws_key }}'
instance_type: '{{ item.type }}'
region: '{{ aws_region }}'
image: ami-e0c19f83
wait: yes
group: '{{ hadoop_cluster }}-sg'
# placement_group: '{{ aws_placement_group }}'
count: 1
vpc_subnet_id: '{{ aws_subnet }}'
assign_public_ip: yes
instance_tags:
hostname: '{{ item.hostname }}'
tags: '{{ item.tags }}'
with_items:
- { type: 't2.small', hostname: 'kafka-1', tags: 'hdp-cluster-1,hdfs,kafka' }
- { type: 't2.small', hostname: 'kafka-2', tags: 'hdp-cluster-1,hdfs,kafka' }
tags: [kafka-brokers]
- name: Provision storm nodes
ec2:
key_name: '{{ aws_key }}'
instance_type: '{{ item.type }}'
region: '{{ aws_region }}'
image: ami-e0c19f83
wait: yes
group: '{{ hadoop_cluster }}-sg'
# placement_group: '{{ aws_placement_group }}'
count: 1
vpc_subnet_id: '{{ aws_subnet }}'
assign_public_ip: yes
instance_tags:
hostname: '{{ item.hostname }}'
tags: '{{ item.tags }}'
with_items:
- { type: 't2.large', hostname: 'storm-supervisor-1', tags: 'hdp-cluster-1,hdfs,storm-supervisor' }
- { type: 't2.large', hostname: 'storm-supervisor-2', tags: 'hdp-cluster-1,hdfs,storm-supervisor' }
tags: [storm-nodes]