-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSCM-Path(B)-Cloudera production deployment
More file actions
307 lines (183 loc) · 7.48 KB
/
SCM-Path(B)-Cloudera production deployment
File metadata and controls
307 lines (183 loc) · 7.48 KB
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
***********************************************
Cloudera production deployment (Path-B)
***********************************************
-----*** Update the server ***-----
$ sudo apt-get update && sudo apt-get dist-upgrade -y
-----*** Disable transparent huge pages ***-----
$ sudo nano /etc/rc.local
## Add these lines:
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi
$sudo -i
$source /etc/rc.local
-----*** Install NTP ***-----
$ sudo apt-get install ntp -y
$ sudo service ntp status
## If it isn't running
$ sudo service ntp start
-----*** Set Swappiness ***-----
sudo sysctl -a | grep vm.swappiness
sudo sysctl vm.swappiness=1
-----*** Setting root reserved space ***-----
$ sudo lsblk
$ sudo tune2fs -l /dev/xvda1
$ sudo tune2fs -l /dev/xvda1 | egrep "Block count|Reserved block count"
$ sudo tune2fs -m 1 /dev/xvda1
$ sudo tune2fs -l /dev/xvda1 | egrep "Block count|Reserved block count"
### Note : Now, save the instance to an image, call it “Cloudera Manager” Make sure to
check “No reboot”
##### Preparing external database for cloudera #####
-----*** Install MySQL ***-----
sudo apt-get install mysql-server -y
-----*** Stop mysql ***-----
sudo service mysql stop
sudo service mysql status
-----*** Move innodb log file ***-----
mkdir mysqlbup
sudo su
cd /var/lib/mysql
mv ib_logfile0 /home/ubuntu/mysqlbup/
mv ib_logfile1 /home/ubuntu/mysqlbup/
exit
-----*** Edit the option file my.cnf to cloudera recommended settings ***-----
sudo su
cd /etc/mysql
nano my.cnf
==============================================================================
[mysqld]
transaction-isolation = READ-COMMITTED
# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links = 0
key_buffer_size = 32M
max_allowed_packet = 32M
thread_stack = 256K
thread_cache_size = 64
query_cache_limit = 8M
query_cache_size = 64M
query_cache_type = 1
max_connections = 550
#expire_logs_days = 10
#max_binlog_size = 100M
#log_bin should be on a disk with enough free space. Replace '/var/lib/mysql/mysql_binary_log' with an appropriate path for your system
#and chown the specified folder to the mysql user.
log_bin=/var/lib/mysql/mysql_binary_log
# For MySQL version 5.1.8 or later. For older versions, reference MySQL documentation for configuration help.
binlog_format = mixed
read_buffer_size = 2M
read_rnd_buffer_size = 16M
sort_buffer_size = 8M
join_buffer_size = 8M
# InnoDB settings
innodb_file_per_table = 1
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 64M
innodb_buffer_pool_size = 4G
innodb_thread_concurrency = 8
innodb_flush_method = O_DIRECT
innodb_log_file_size = 512M
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
sql_mode=STRICT_ALL_TABLES
==========================================================================
-----*** Make mysql start on boot ***----
sudo update-rc.d mysql defaults
-----*** Start mysql ***-----
sudo service mysql start
-----*** Mysql secure install ***----
$ sudo /usr/bin/mysql_secure_installation
[...]
Enter current password for root (enter for none):
OK, successfully used password, moving on...
[...]
Set root password? [Y/n] y
New password:
Re-enter new password:
Remove anonymous users? [Y/n] Y
[...]
Disallow root login remotely? [Y/n] N
[...]
Remove test database and access to it [Y/n] Y
[...]
Reload privilege tables now? [Y/n] Y
All done!
-----*** Install mysql JDBC driver ***-----
sudo apt-get install libmysql-java
#### Establish Your Cloudera Manager Repository #####
curl https://archive.cloudera.com/cm5/ubuntu/trusty/amd64/cm/cloudera.list > cloudera-manager.list
(Link for cloudera manager repo url : https://www.cloudera.com/documentation/enterprise/release-notes/topics/cm_vd.html )
nano cloudera-manager.list
(change >> deb https://archive.cloudera.com/cm5/ubuntu/lucid/amd64/cm trusty-cm5 contrib to deb https://archive.cloudera.com/cm5/ubuntu/lucid/amd64/cm trusty-cm5.9.3 contrib)
sudo mv cloudera-manager.list /etc/apt/sources.list.d/
sudo apt-get update
(if you see : GPG error .... NO_PUBKEY then
sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com 327574EE02A818DD)
sudo apt-get update
##### Install Cloudera Manager server software #####
-----*** Install Oracle JDK ***-----
sudo apt-get install oracle-j2sdk1.7 -y
-----*** Install the Cloudera Manager Server Packages ***-----
sudo apt-get install cloudera-manager-daemons cloudera-manager-server
##### Setting up the Cloudera Manager Server Database #####
mysql -u root -p
mysql>CREATE DATABASE cmdb;
mysql> CREATE USER 'cm'@'localhost' IDENTIFIED BY 'password';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'cm'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
mysql> exit;
sudo /usr/share/cmf/schema/scm_prepare_database.sh -p mysql cmdb cm password
##### Start the Cloudera Manager Server #####
sudo service cloudera-scm-server start
##### Setup custom CDH repository #####
cd /opt/cloudera/parcel-repo/
sudo wget http://archive.cloudera.com/cdh5/parcels/5.9/CDH-5.9.3-1.cdh5.9.3.p0.4-trusty.parcel
sudo wget http://archive.cloudera.com/cdh5/parcels/5.9/CDH-5.9.3-1.cdh5.9.3.p0.4-trusty.parcel.sha1
sudo mv CDH-5.9.3-1.cdh5.9.3.p0.4-trusty.parcel.sha1 CDH-5.9.3-1.cdh5.9.3.p0.4-trusty.parcel.sha
sudo wget http://archive.cloudera.com/cdh5/parcels/5.9/manifest.json
ll
sudo chown cloudera-scm:cloudera-scm CDH-5.9.3-1.cdh5.9.3.p0.4-trusty.parcel
sudo chown cloudera-scm:cloudera-scm CDH-5.9.3-1.cdh5.9.3.p0.4-trusty.parcel.sha
sudo chown cloudera-scm:cloudera-scm manifest.json
(Address for CDH parcels : http://archive.cloudera.com/cdh5/parcels/)
-----*** Restart Cloudera manager server ***-----
sudo service cloudera-scm-server restart
## Login to CM web UI on 7180
After assigning service roles to hosts, when you are on database setup page, do following
##### Create database for CDH services #####
mysql -u root -p
>> For reports manager
mysql> create database rman DEFAULT CHARACTER SET utf8;
mysql> CREATE USER 'rman'@'<pri-dns>' IDENTIFIED BY 'password';
(Note : Enter pri-dns of host where the particular service is running)
mysql> grant all on rman.* TO 'rman'@'<pri-dns>' IDENTIFIED BY 'password';
>> For Hive
mysql> create database metastore DEFAULT CHARACTER SET utf8;
mysql> CREATE USER 'hive'@'<pri-dns>' IDENTIFIED BY 'password';
mysql> grant all on metastore.* TO 'hive'@'<pri-dns>' IDENTIFIED BY 'password';
>> For Oozie
mysql> create database oozie default character set utf8;
mysql> CREATE USER 'oozie'@'<pri-dns>' IDENTIFIED BY 'password';
mysql> grant all privileges on oozie.* to 'oozie'@'<pri-dns>' identified by 'password';
== Add mysql driver jar
sudo cp /usr/share/java/mysql-connector-java-5.1.28.jar /opt/cloudera/parcels/CDH/lib/oozie/lib/
>> For Hue
sudo su
cd /etc/mysql
nano my.cnf
[mysqld]
...
bind-address=0.0.0.0
sql_mode=STRICT_ALL_TABLES
sudo service mysql restart
mysql -u root -p
mysql> create database hue default character set utf8 default collate utf8_general_ci;
mysql> CREATE USER 'hue'@'<pri-dns>' IDENTIFIED BY 'password';
mysql> grant all on hue.* to 'hue'@'<pri-dns>' identified by 'password';
##### Install Mysql jdbc jar on hosts where services are running #####
sudo apt-get install libmysql-java
sudo cp /usr/share/java/mysql-connector-java-5.1.28.jar /opt/cloudera/parcels/CDH/lib/oozie/lib/
## Now continue installation on CM web ui