This repository has been archived by the owner on May 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 126
/
site.yml
283 lines (254 loc) · 7.31 KB
/
site.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
---
# Site Configuration
# ==================
- hosts: all
user: ansibler
tasks:
- name: determine interface
set_fact: ipv4_address="{{ hostvars[inventory_hostname].ansible_default_ipv4.address }}"
# eg. to use a eth1: ipv4_address="{{ hostvars[inventory_hostname].ansible_eth1.ipv4.address }}"
- hosts: all
user: ansibler
sudo: true
roles:
- { role: kernel, when: upgrade_kernel and not ansible_kernel.startswith('3.13') }
- common
- { role: postfix_mandrill, when: notify_email is defined and postfix_domain is defined and mandrill_username is defined and mandrill_api_key is defined }
- ganglia_monitor
- { role: oracle_jdk, when: jdk_installed is not defined }
- hosts: 2_links_aggregated
user: ansibler
sudo: true
roles:
- { role: 2_aggregated_links, when: bond_mode is defined and mtu is defined and ansible_virtualization_role == "host" and ansible_interfaces|length == 3 and "bond0" not in ansible_interfaces }
- hosts: elasticsearch
user: ansibler
sudo: true
roles:
- elasticsearch
- elasticsearch_curator
- hosts: monitors[0]
user: ansibler
sudo: true
roles:
- ganglia_metad
- ganglia_web
- kibana
- smokeping
- hosts: all
user: ansibler
sudo: true
roles:
- td_agent
- rsyslog_fluentd
# Hadoop
- hosts: zookeepers:journalnodes:resourcemanager:nodemanagers:historyserver:hbase_masters:regionservers
user: ansibler
sudo: true
roles:
- cdh_common
- cdh_hadoop_config
- hosts: zookeepers
user: ansibler
sudo: true
roles:
- cdh_zookeeper_server
- hosts: journalnodes
user: ansibler
sudo: true
roles:
- cdh_hadoop_journalnode
- hosts: namenodes[0]
user: ansibler
sudo: true
sudo_user: hdfs
tasks:
- name: create the /data/dfs/nn directory
file: path=/data/dfs/nn owner=hdfs group=hdfs state=directory
tags:
- hadoop
- hbase
- hive
- name: format the namenode - WILL NOT FORMAT IF /data/dfs/nn/current/VERSION EXISTS TO AVOID DATA LOSS
command: creates=/data/dfs/nn/current/VERSION hdfs namenode -format -force
tags:
- hadoop
- hbase
- hive
- hosts: namenodes[0]
user: ansibler
sudo: true
roles:
- cdh_hadoop_namenode
- cdh_hadoop_zkfc
- hosts: namenodes[1]
user: ansibler
sudo: true
sudo_user: hdfs
tasks:
- name: wait for the first namenode to come online
wait_for: host={{ hostvars[groups['namenodes'][0]].ipv4_address|default(hostvars[groups['namenodes'][0]].ansible_default_ipv4.address) }} port=50070
tags:
- hadoop
- hbase
- hive
- name: create the /data/dfs/nn directory
file: path=/data/dfs/nn owner=hdfs group=hdfs state=directory
tags:
- hadoop
- hbase
- hive
- name: bootstrap the standby namenode
shell: creates=/data/dfs/nn/.bootstrapped hdfs namenode -bootstrapStandby && touch /data/dfs/nn/.bootstrapped
tags:
- hadoop
- hbase
- hive
- hosts: namenodes[1]
user: ansibler
sudo: true
roles:
- cdh_hadoop_namenode
- cdh_hadoop_zkfc
- hosts: namenodes[0]
user: ansibler
sudo: true
tasks:
- name: format hadoop-hdfs-zkfc
shell: creates=/data/dfs/.zkfsformatted hdfs zkfc -formatZK -force && touch /data/dfs/.zkfsformatted
tags:
- hadoop
- hbase
- hive
- name: start zkfc
service: name=hadoop-hdfs-zkfc state=restarted
tags:
- hadoop
- hbase
- hive
- name: restart namenode
service: name=hadoop-hdfs-namenode state=restarted
tags:
- hadoop
- hbase
- hive
- hosts: datanodes
user: ansibler
sudo: true
roles:
- cdh_hadoop_datanode
- hosts: nodemanagers
user: ansibler
sudo: true
roles:
- cdh_hadoop_mapreduce
- hosts: hbase_masters:regionservers
user: ansibler
sudo: true
roles:
- cdh_hbase_config
- hosts: namenodes[0]
user: ansibler
sudo: true
sudo_user: hdfs
tasks:
- name: create /tmp directory on the cluster
shell: creates=/data/dfs/.tmpdircreated hadoop fs -mkdir /tmp && touch /data/dfs/.tmpdircreated
tags:
- hadoop
- hadoop_fs
- name: make sure the /tmp directory has the correct permissions
shell: creates=/data/dfs/.tmpdirchowned sleep 5 && hadoop fs -chmod -R 1777 /tmp && touch /data/dfs/.tmpdirchowned
tags:
- hadoop
- hadoop_fs
- name: create a /user/history directory on the cluster
shell: creates=/data/dfs/.historydircreated hadoop fs -mkdir /user/history && touch /data/dfs/.historydircreated
tags:
- hadoop
- hadoop_fs
- name: make sure the /user/history directory has the correct permissions
shell: creates=/data/dfs/.historydirchmodded sleep 5 && hadoop fs -chmod -R 1777 /user/history && touch /data/dfs/.historydirchmodded
tags:
- hadoop
- hadoop_fs
- name: make sure the /user/history directory has the correct owner
shell: creates=/data/dfs/.historydirchowned sleep 5 && hadoop fs -chown yarn:mapred /user/history && touch /data/dfs/.historydirchowned
tags:
- hadoop
- hadoop_fs
- name: create the /hbase directory on the cluster
shell: creates=/data/dfs/.hbasedircreated hadoop fs -mkdir /hbase && touch /data/dfs/.hbasedircreated
tags:
- hbase
- hadoop_fs
- name: make sure the /hbase directory has the correct owner
shell: creates=/data/dfs/.hbasedirchowned sleep 5 && hadoop fs -chown hbase:hbase /hbase && touch /data/dfs/.hbasedirchowned
tags:
- hbase
- hadoop_fs
- hosts: resourcemanager
user: ansibler
sudo: true
roles:
- cdh_hadoop_yarn_resourcemanager
- hosts: nodemanagers
user: ansibler
sudo: true
roles:
- cdh_hadoop_yarn_nodemanager
- hosts: historyserver
user: ansibler
sudo: true
roles:
- cdh_hadoop_mapreduce_historyserver
- cdh_hadoop_yarn_proxyserver
- hosts: hbase_masters
user: ansibler
sudo: true
roles:
- cdh_hbase_master
- hosts: regionservers
user: ansibler
sudo: true
roles:
- cdh_hbase_regionserver
- hosts: hive_metastore
user: ansibler
sudo: true
roles:
- { role: postgresql_server, when: hive_metastore == "postgresql" }
- { role: cdh_hive_postgresql_metastore, when: hive_metastore == "postgresql" }
- { role: mysql_server, when: hive_metastore == "mysql" }
- { role: cdh_hive_mysql_metastore, when: hive_metastore == "mysql" }
- cdh_hive_config
- hosts: hive_metastore
user: ansibler
sudo: true
roles:
- cdh_hive_metastore
- hosts: namenodes[0]
user: ansibler
sudo: true
sudo_user: hdfs
tasks:
- name: create a /user/hive/warehouse directory on the cluster
shell: creates=/data/dfs/.hivewarehousedircreated hadoop fs -mkdir /user/hive/warehouse && touch /data/dfs/.hivewarehousedircreated
tags:
- hive
- hadoop_fs
- name: make sure the /user/hive/warehouse directory has the correct permissions
shell: creates=/data/dfs/.hivewarehousedirchmodded sleep 5 && hadoop fs -chmod -R 1777 /user/hive/warehouse && touch /data/dfs/.hivewarehousedirchmodded
tags:
- hive
- hadoop_fs
- hosts: presto_coordinators
user: ansibler
sudo: true
roles:
- presto_coordinator
- hosts: presto_workers
user: ansibler
sudo: true
roles:
- presto_worker