-
Notifications
You must be signed in to change notification settings - Fork 1.8k
/
cdh-single-install-with-vars.yml
289 lines (289 loc) · 7.78 KB
/
cdh-single-install-with-vars.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
- name: cdh install
hosts: cdh_group
gather_facts: True
vars_files:
- vars.yml
tasks:
- name: update yum
command: yum update -y
- name: install ntpdate
yum: name=ntpdate state=present
- name: ntpdate
command: ntpdate cn.ntp.org.cn
- name: stop and disable firewalld
service: name=firewalld state=stopped enabled=no
- name: disable SELINUX
selinux: state=disabled
- name: swap off
command: sed -ri 's/.*swap.*/#&/' /etc/fstab
- name: create jdk package
file:
path: /usr/lib/jvm
state: directory
mode: '0777'
- name: scp jdk install file
copy: src=~/playbooks/cdh6/jdk-8u191-linux-x64.tar.gz dest=/usr/lib/jvm/
- name: create jdbc package
file:
path: /usr/share/java
state: directory
mode: '0777'
- name: scp jdbc file
copy: src=~/playbooks/cdh6/mysql-connector-java-5.1.34.jar dest=/usr/share/java/mysql-connector-java.jar
- name: unarchive jdk install file from ansible
unarchive:
src: ~/playbooks/cdh6/jdk-8u191-linux-x64.tar.gz
dest: /usr/lib/jvm/
- name: Ensure JAVA_HOME is set
lineinfile:
path: /etc/profile
regexp: '^(.*)JAVA_HOME=(.*)$'
line: export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_191
- name: Ensure JRE_HOME is set
lineinfile:
path: /etc/profile
line: export JRE_HOME=${JAVA_HOME}/jre
- name: Ensure CLASSPATH is set
lineinfile:
path: /etc/profile
line: export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
- name: Ensure JAVA_HOME exists in PATH
lineinfile:
path: /etc/profile
line: export PATH=${JAVA_HOME}/bin:$PATH
- name: create softlink path of jdk
file:
path: /usr/java
state: directory
mode: '0777'
- name: create jdk softlink
file:
path: /usr/java/default
state: link
src: /usr/lib/jvm/jdk1.8.0_191
- name: install chkconfig
yum: name=chkconfig state=present
- name: install bind-utils
yum: name=bind-utils state=present
- name: install psmisc
yum: name=psmisc state=present
- name: install libxslt
yum: name=libxslt state=present
- name: install zlib
yum: name=zlib state=present
- name: install sqlite
yum: name=sqlite state=present
- name: install cyrus-sasl-plain
yum: name=cyrus-sasl-plain state=present
- name: install cyrus-sasl-gssapi
yum: name=cyrus-sasl-gssapi state=present
- name: install fuse
yum: name=fuse state=present
- name: install fuse-libs
yum: name=fuse-libs state=present
- name: install redhat-lsb
yum: name=redhat-lsb state=present
- name: set transparent_hugepage defrag
lineinfile:
path: /etc/rc.local
line: echo never > /sys/kernel/mm/transparent_hugepage/defrag
- name: set transparent_hugepage enabled
lineinfile:
path: /etc/rc.local
line: echo never > /sys/kernel/mm/transparent_hugepage/enabled
- name: install mariadb-server
yum: name=mariadb-server state=present
- name: start and enable mariadb
service: name=mariadb state=started enabled=yes
- name: install MySQL-python
yum: name=MySQL-python state=present
- name: create database user cdh
mysql_user:
name: cdh
password: 123456
priv: '*.*:ALL,GRANT'
state: present
- name: create database scm
mysql_db:
login_user: cdh
login_host: 127.0.0.1
login_password: 123456
name: scm
encoding: utf8
state: present
- name: create database amon
mysql_db:
login_user: cdh
login_host: 127.0.0.1
login_password: 123456
name: amon
encoding: utf8
state: present
- name: create database rman
mysql_db:
login_user: cdh
login_host: 127.0.0.1
login_password: 123456
name: rman
encoding: utf8
state: present
- name: create database hue
mysql_db:
login_user: cdh
login_host: 127.0.0.1
login_password: 123456
name: hue
encoding: utf8
state: present
- name: create database hive
mysql_db:
login_user: cdh
login_host: 127.0.0.1
login_password: 123456
name: hive
encoding: utf8
state: present
- name: create database sentry
mysql_db:
login_user: cdh
login_host: 127.0.0.1
login_password: 123456
name: sentry
encoding: utf8
state: present
- name: create database nav
mysql_db:
login_user: cdh
login_host: 127.0.0.1
login_password: 123456
name: nav
encoding: utf8
state: present
- name: create database navms
mysql_db:
login_user: cdh
login_host: 127.0.0.1
login_password: 123456
name: navms
encoding: utf8
state: present
- name: create database oozie
mysql_db:
login_user: cdh
login_host: 127.0.0.1
login_password: 123456
name: oozie
encoding: utf8
state: present
- name: create database user scm
mysql_user:
name: scm
password: scm
priv: 'scm.*:ALL'
state: present
- name: create database user amon
mysql_user:
name: amon
password: amon
priv: 'amon.*:ALL'
state: present
- name: create database user rman
mysql_user:
name: rman
password: rman
priv: 'rman.*:ALL'
state: present
- name: create database user hue
mysql_user:
name: hue
password: hue
priv: 'hue.*:ALL'
state: present
- name: create database user hive
mysql_user:
name: hive
password: hive
priv: 'hive.*:ALL'
state: present
- name: create database user sentry
mysql_user:
name: sentry
password: sentry
priv: 'sentry.*:ALL'
state: present
- name: create database user nav
mysql_user:
name: nav
password: nav
priv: 'nav.*:ALL'
state: present
- name: create database user navms
mysql_user:
name: navms
password: navms
priv: 'navms.*:ALL'
state: present
- name: create database user oozie
mysql_user:
name: oozie
password: oozie
priv: 'oozie.*:ALL'
state: present
- name: create install files package
file:
path: ~/cdh-install-files
state: directory
mode: '0777'
- name: scp cloudera-manager-daemons install file
copy:
src: ~/playbooks/cdh6/{{cm_daemons}}
dest: ~/cdh-install-files
mode: '0777'
- name: scp cloudera-manager-agent install file
copy:
src: ~/playbooks/cdh6/{{cm_agent}}
dest: ~/cdh-install-files
mode: '0777'
- name: scp cloudera-manager-server install file
copy:
src: ~/playbooks/cdh6/{{cm_server}}
dest: ~/cdh-install-files
mode: '0777'
- name: remove cloudera-manager-server package
yum:
name: cloudera-manager-server.x86_64
state: absent
- name: remove cloudera-manager-agent.x86_64 package
yum:
name: cloudera-manager-agent.x86_64
state: absent
- name: remove cloudera-manager-daemons package
yum:
name: cloudera-manager-daemons.x86_64
state: absent
- name: install cloudera-manager-daemons
command: yum install -y ~/cdh-install-files/{{cm_daemons}}
- name: install cloudera-manager-agent
command: yum install -y ~/cdh-install-files/{{cm_agent}}
- name: install cloudera-manager-server
command: yum install -y ~/cdh-install-files/{{cm_server}}
- name: switch off agent tls
lineinfile:
path: /etc/cloudera-scm-agent/config.ini
regexp: '^(.*)use_tls=(.*)$'
line: use_tls=0
- name: create parcel package
file:
path: /opt/cloudera/parcel-repo/
state: directory
mode: '0777'
- name: scp parcel file
copy:
src: ~/playbooks/cdh6/{{parcel}}
dest: /opt/cloudera/parcel-repo/
mode: '0777'
- name: scp parcel sha file
copy:
src: ~/playbooks/cdh6/{{parcel_sha}}
dest: /opt/cloudera/parcel-repo/
mode: '0777'