forked from dwatrous/hadoop-multi-server-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheat-hadoop-cluster.yaml
124 lines (116 loc) · 3.98 KB
/
heat-hadoop-cluster.yaml
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
heat_template_version: 2013-05-23
description: >
HOT template to deploy an automation server to host the REST API for
onboarding automation and assign a floating IP address to the server
parameters:
key_name:
type: string
description: Name of keypair to assign to servers
default: KEYPAIR
image_id:
type: string
description: ID of image to use for servers
default: IMAGEID
admin_user:
type: string
description: Username of admin user
default: ADMINUSER
flavor:
type: string
description: Flavor to use for servers
default: FLAVOR
public_net_id:
type: string
description: >
ID of public network for which floating IP addresses will be allocated
default: PUBNETID
private_net_id:
type: string
description: ID of private network into which servers get deployed
default: PRIVNETID
private_subnet_id:
type: string
description: ID of private sub network into which servers get deployed
default: PRIVSUBNETID
ssh_security_group:
type: string
description: ID of a security-group that allows SSH traffic
default: SSHSECGRPID
resources:
hadoop_master_server:
type: OS::Nova::Server
properties:
name: hadoop_master
admin_user: { get_param: admin_user }
image: { get_param: image_id }
flavor: { get_param: flavor }
key_name: { get_param: key_name }
networks:
- port: { get_resource: hadoop_master_server_port }
hadoop_master_server_port:
type: OS::Neutron::Port
properties:
network_id: { get_param: private_net_id }
fixed_ips:
- subnet_id: { get_param: private_subnet_id }
security_groups: [{ get_resource: hadoop_security_group }, { get_param: ssh_security_group }]
hadoop_master_server_floating_ip:
type: OS::Neutron::FloatingIP
properties:
floating_network_id: { get_param: public_net_id }
port_id: { get_resource: hadoop_master_server_port }
hadoop_security_group:
type: OS::Neutron::SecurityGroup
properties:
description: Add security group rules for server
name: hadoop-security-group
rules:
- remote_ip_prefix: 0.0.0.0/0
protocol: tcp
port_range_min: 50070
port_range_max: 50070
- remote_ip_prefix: 0.0.0.0/0
protocol: tcp
port_range_min: 50075
port_range_max: 50075
# update the following remote_ip_prefix to match the subnet of your private network
- remote_ip_prefix: 172.16.0.0/24
protocol: tcp
port_range_min: 1
port_range_max: 65535
- remote_ip_prefix: 0.0.0.0/0
protocol: tcp
port_range_min: 8088
port_range_max: 8088
- remote_ip_prefix: 0.0.0.0/0
protocol: icmp
nodes:
type: OS::Heat::ResourceGroup
properties:
count: 2
resource_def:
type: heat-datanode.yaml
properties:
server_name: hadoop-data-%index%
hadoop_security_group: { get_resource: hadoop_security_group }
key_name: { get_param: key_name }
image_id: { get_param: image_id }
admin_user: { get_param: admin_user }
flavor: { get_param: flavor }
public_net_id: { get_param: public_net_id }
private_net_id: { get_param: private_net_id }
private_subnet_id: { get_param: private_subnet_id }
ssh_security_group: { get_param: ssh_security_group }
outputs:
hadoop_master_private_ip:
description: IP address of Hadoop Master in private network
value: { get_attr: [ hadoop_master_server, first_address ] }
hadoop_master_public_ip:
description: Floating IP address of Hadoop Master in public network
value: { get_attr: [ hadoop_master_server_floating_ip, floating_ip_address ] }
nodes_public_ips:
description: Public IP for datanode
value: {get_attr: [nodes, hadoop_node_public_ip]}
nodes_private_ips:
description: Private IP for datanode
value: {get_attr: [nodes, hadoop_node_private_ip]}