搭建德国CDH(踩坑无数后整理版)

搭建德国CDH(踩坑无数后整理版)

十二月 18, 2019

注: 发出来的文档包含IP皆为内网IP,密码也为文档效果更改

#####三台CentOS Linux release 7.5.1804 (Core)服务器:
[cdh]
172.17.4.9
172.17.4.10
172.17.4.11
#####新建一个普通用户,给予超级用户权限(所有节点):
[root@cdh1-172-17-4-9 ~]# groupadd -r aiot
[root@cdh1-172-17-4-9 ~]# useradd -d /home/aiot/ -m -s /bin/bash -c “administrator user” -g aiot -p passwd -r aiot
[root@cdh1-172-17-4-9 ~]# passwd aiot
更改用户 aiot 的密码 。
新的 密码:passwd
无效的密码: 密码包含用户名在某些地方
重新输入新的 密码:passwd
passwd:所有的身份验证令牌已经成功更新。
[root@cdh1-172-17-4-9 ~]# vim /etc/sudoers

1
2
root    ALL=(ALL)       ALL
aiot ALL=(ALL) NOPASSWD: ALL

#####安装必要包(所有节点):
yum install httpd -y
yum install ntp -y

#####配置域名解析、主机名(所有节点):

[root@cdh1-172-17-4-9 ~]# cat /etc/hosts

1
2
3
4
5
6
7
::1 VM_4_4_centos VM_4_4_centos
::1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
127.0.0.1 localhost localhost.localdomain VM_4_9_centos
172.17.4.9 cdh1-172-17-4-9
172.17.4.10 cdh2-172-17-4-10
172.17.4.11 cdh3-172-17-4-11

[root@cdh1-172-17-4-9 ~]# hostnamectl set-hostname cdh1-172-17-4-9
[root@cdh2-172-17-4-10 ~]# cat /etc/hosts

1
2
3
4
5
6
7
8
9
127.0.0.1 VM_4_10_centos VM_4_10_centos
127.0.0.1 localhost.localdomain localhost
127.0.0.1 localhost4.localdomain4 localhost4
::1 VM_4_10_centos VM_4_10_centos
::1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
172.17.4.9 cdh1-172-17-4-9
172.17.4.10 cdh2-172-17-4-10
172.17.4.11 cdh3-172-17-4-11

[root@cdh2-172-17-4-10 ~]# hostnamectl set-hostname cdh2-172-17-4-10
[root@cdh3-172-17-4-11 ~]# cat /etc/hosts

1
2
3
4
5
6
7
8
9
127.0.0.1 VM_4_11_centos VM_4_11_centos
127.0.0.1 localhost.localdomain localhost
127.0.0.1 localhost4.localdomain4 localhost4
::1 VM_4_11_centos VM_4_11_centos
::1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
172.17.4.9 cdh1-172-17-4-9
172.17.4.10 cdh2-172-17-4-10
172.17.4.11 cdh3-172-17-4-11

[root@cdh3-172-17-4-11 ~]# hostnamectl set-hostname cdh3-172-17-4-11

#####关闭防火墙和SELINUX(所有节点):
[root@cdh1-172-17-4-9 ~]# getenforce
Disabled
[root@cdh1-172-17-4-9 ~]# systemctl stop firewalld
[root@cdh1-172-17-4-9 ~]# systemctl disable firewalld.service
[root@cdh1-172-17-4-9 ~]# vim /etc/selinux/config
SELINUX=disabled

#####切换普通用户,配置三机互信(所有节点):
[root@cdh1-172-17-4-9 ~]# su - aiot
[aiot@cdh1-172-17-4-9 ~]$ whoami
aiot
[aiot@cdh1-172-17-4-9 ~]$ mkdir .ssh
[aiot@cdh1-172-17-4-9 ~]$ chmod 750 .ssh
[aiot@cdh1-172-17-4-9 ~]$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/aiot//.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/aiot//.ssh/id_rsa.
Your public key has been saved in /home/aiot//.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:MEtv2UxJl5VddGmG+RegPLaTi8n2Z0fo6LHHEbJthYw aiot@cdh1-172-17-4-9
The key’s randomart image is:
+—[RSA 2048]—-+
| . .+=+|
| ..ooo.=o|
| + o=o = .|
| . = =.E++ o.|
| . S o++ + .|
| .. o.o= . |
| = o= o |
| . ..o
. |
| .++ . |
+—-[SHA256]—–+
[aiot@cdh1-172-17-4-9 ~]$ cat /home/aiot/.ssh/id_rsa.pub >> /home/aiot/.ssh/authorized_keys
[aiot@cdh1-172-17-4-9 ~]$ chmod 600 /home/aiot/.ssh/authorized_keys
[aiot@cdh1-172-17-4-9 ~]$ cat .ssh/authorized_keys

1
ssh-rsa ********* aiot@cdh1-172-17-4-9

[aiot@cdh1-172-17-4-9 ~]$ vim .ssh/authorized_keys
[aiot@cdh1-172-17-4-9 ~]$ cat .ssh/authorized_keys

1
2
3
ssh-rsa ********* aiot@cdh1-172-17-4-9
ssh-rsa ********* aiot@cdh2-172-17-4-10
ssh-rsa ********* aiot@cdh3-172-17-4-11

[aiot@cdh1-172-17-4-9 ~]$ ssh 172.17.4.10 date
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘172.17.4.10’ (ECDSA) to the list of known hosts.
Mon Dec 23 10:16:27 CST 2019
[aiot@cdh1-172-17-4-9 ~]$ logout

#####配置时钟同步(所有节点):

[root@cdh1-172-17-4-9 ~]# sudo vim /etc/ntp.conf

1
2
3
4
5
6
7
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org

[root@cdh1-172-17-4-9 ~]# sudo systemctl enable ntpd
[root@cdh1-172-17-4-9 ~]# sudo systemctl start ntpd
[root@cdh1-172-17-4-9 ~]# sudo systemctl status ntpd
● ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; vendor preset: disabled)
Active: active (running) since 一 2019-12-23 09:56:25 CST; 22min ago
Main PID: 10113 (ntpd)
CGroup: /system.slice/ntpd.service
└─10113 /usr/sbin/ntpd -u ntp:ntp -g
12月 23 09:56:25 cdh1-172-17-4-9 ntpd[10113]: ntp_io: estimated max descriptors: 1024, initial socket boundary: 16
12月 23 09:56:25 cdh1-172-17-4-9 ntpd[10113]: Listen normally on 0 lo 127.0.0.1 UDP 123
12月 23 09:56:25 cdh1-172-17-4-9 ntpd[10113]: Listen normally on 1 eth0 172.17.4.9 UDP 123
12月 23 09:56:25 cdh1-172-17-4-9 ntpd[10113]: Listen normally on 2 lo ::1 UDP 123
12月 23 09:56:25 cdh1-172-17-4-9 ntpd[10113]: Listen normally on 3 eth0 fe80::5054:ff:feeb:37bf UDP 123
12月 23 09:56:25 cdh1-172-17-4-9 ntpd[10113]: Listening on routing socket on fd #20 for interface updates
12月 23 09:56:25 cdh1-172-17-4-9 ntpd[10113]: 0.0.0.0 c016 06 restart
12月 23 09:56:25 cdh1-172-17-4-9 ntpd[10113]: 0.0.0.0 c012 02 freq_set kernel -2.846 PPM
12月 23 09:56:25 cdh1-172-17-4-9 systemd[1]: Started Network Time Service.
12月 23 09:56:32 cdh1-172-17-4-9 ntpd[10113]: 0.0.0.0 c615 05 clock_sync

#####禁用大透明页,设置vm.swappiness(主节点):

[root@cdh1-172-17-4-9 ~]# sudo vim /etc/sysctl.conf

1
vm.swappiness=10

[aiot@cdh1-172-17-4-9 ~]$ sudo sysctl vm.swappiness=10
vm.swappiness = 10
[aiot@cdh1-172-17-4-9 ~]$ sudo vim /etc/rc.local

1
2
echo never > /sys/kernel/mm/transparent_hugepage/defrag
echo never > /sys/kernel/mm/transparent_hugepage/enabled

[aiot@cdh1-172-17-4-9 ~]$ sudo chmod +x /etc/rc.d/rc.local

并在终端使用root执行

1
2
# echo never > /sys/kernel/mm/transparent_hugepage/defrag
# echo never > /sys/kernel/mm/transparent_hugepage/enabled

#####安装jdk(所有节点):

[aiot@cdh1-172-17-4-9 ~]$ sudo rpm -qa | grep java
[aiot@cdh1-172-17-4-9 ~]$ sudo mkdir -p /usr/java
下载java、mysql-connecter
[aiot@cdh1-172-17-4-9 ~]$ sudo tar -zxvf /tmp/jdk-8u181-linux-x64.tar.gz -C /usr/java/
[aiot@cdh1-172-17-4-9 ~]$ sudo ln -s /usr/java/jdk1.8.0_181 /usr/java/jdk
[aiot@cdh1-172-17-4-9 ~]$ sudo vim /etc/profile

1
2
3
export JAVA_HOME=/usr/java/jdk
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib:$CLASSPATH

[aiot@cdh1-172-17-4-9 ~]$ source /etc/profile
[aiot@cdh1-172-17-4-9 ~]$ vim ~/.bashrc

1
2
3
export JAVA_HOME=/usr/java/jdk
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib:$CLASSPATH

[aiot@cdh1-172-17-4-9 ~]$ vim ~/.bash_profile
export JAVA_HOME=/usr/java/jdk
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib:$CLASSPATH
[aiot@cdh1-172-17-4-9 ~]$ echo $JAVA_HOME
/usr/java/jdk

#####拷贝数据库连接jar包(所有节点):

[aiot@cdh1-172-17-4-9 ~]$ sudo mkdir -p /usr/share/java
[aiot@cdh1-172-17-4-9 ~]$ sudo cp /tmp/mysql-connector-java-5.1.46.jar /usr/share/java/mysql-connector-java.jar
[aiot@cdh1-172-17-4-9 ~]$ ls /usr/share/java/
mysql-connector-java.jar

#####安装mysql57并建库授权(所有节点):

[aiot@cdh1-172-17-4-9 ~]$ sudo rpm -qa | grep mariadb
mariadb-libs-5.5.56-2.el7.x86_64
[aiot@cdh1-172-17-4-9 ~]$ sudo rpm -e mariadb-libs-5.5.56-2.el7.x86_64 –nodeps
[aiot@cdh1-172-17-4-9 ~]$ sudo rpm -qa | grep mariadb
[aiot@cdh1-172-17-4-9 ~]$ sudo yum -y install libaio
[aiot@cdh2-172-17-4-10 ~]$ cd /tmp
[aiot@cdh2-172-17-4-10 tmp]$ ls
2f0a2e365ded13cde49324756eacd7de nv_driver_install.log
ansible_command_payload_Vt5UHt nv_gpu_conf.log
cvm_init.log setRps.log
hsperfdata_root systemd-private-21cc3095c6d247a897c48ae1c72ff7c6-ntpd.service-e0cbwM
jdk-8u181-linux-x64.tar.gz systemd-private-62cdd337e72f463daa0d3e2e36bc16a9-ntpd.service-hG5zxr
mysql-5.7.20-1.el7.x86_64.rpm-bundle.tar virtio_blk_affinity.log
mysql-connector-java-5.1.46.jar virtio_blk_affinity_udev.log
net_affinity.log
[aiot@cdh2-172-17-4-10 tmp]$ tar -xvf mysql-5.7.20-1.el7.x86_64.rpm-bundle.tar
mysql-community-minimal-debuginfo-5.7.20-1.el7.x86_64.rpm
mysql-community-embedded-5.7.20-1.el7.x86_64.rpm
mysql-community-libs-compat-5.7.20-1.el7.x86_64.rpm
mysql-community-libs-5.7.20-1.el7.x86_64.rpm
mysql-community-embedded-compat-5.7.20-1.el7.x86_64.rpm
mysql-community-devel-5.7.20-1.el7.x86_64.rpm
mysql-community-server-5.7.20-1.el7.x86_64.rpm
mysql-community-server-minimal-5.7.20-1.el7.x86_64.rpm
mysql-community-client-5.7.20-1.el7.x86_64.rpm
mysql-community-test-5.7.20-1.el7.x86_64.rpm
mysql-community-common-5.7.20-1.el7.x86_64.rpm
mysql-community-embedded-devel-5.7.20-1.el7.x86_64.rpm
参考: http://www.seaxiang.com/blog/mysql_libnuma_error
[aiot@cdh1-172-17-4-9 aiot]$ sudo yum install numactl
sudo rpm -ivh mysql-community-common-5.7.20-1.el7.x86_64.rpm
sudo rpm -ivh mysql-community-libs-5.7.20-1.el7.x86_64.rpm
sudo rpm -ivh mysql-community-libs-compat-5.7.20-1.el7.x86_64.rpm
sudo rpm -ivh mysql-community-client-5.7.20-1.el7.x86_64.rpm
sudo rpm -ivh mysql-community-server-5.7.20-1.el7.x86_64.rpm
[aiot@cdh1-172-17-4-9 aiot]$ sudo mkdir -p /data/mysqldata/mysql
[aiot@cdh2-172-17-4-10 aiot]$ sudo su
[root@cdh2-172-17-4-10 aiot]# cp /etc/my.cnf /tmp
[root@cdh2-172-17-4-10 aiot]# echo > /etc/my.cnf
[root@cdh2-172-17-4-10 aiot]# vim /etc/my.cnf

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
[mysqld]
datadir=/data/mysqldata/mysql
socket=/var/lib/mysql/mysql.sock
transaction-isolation=READ-COMMITTED
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
log_bin=/data/mysqldata/mysql/mysql_binary_log
server_id=1
binlog_format=mixed
read_buffer_size=2M
read_rnd_buffer_size=16M
sort_buffer_size=8M
join_buffer_size=8M
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
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
sql_mode=STRICT_ALL_TABLES

[root@cdh1-172-17-4-9 aiot]# exit
[aiot@cdh1-172-17-4-9 aiot]$ sudo systemctl enable mysqld
[aiot@cdh1-172-17-4-9 aiot]$ sudo systemctl start mysqld
[aiot@cdh1-172-17-4-9 aiot]$ sudo systemctl status mysqld -l
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2019-12-23 12:02:52 CST; 4s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 28580 ExecStart=/usr/sbin/mysqld –daemonize –pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=0/SUCCESS)
Process: 28486 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 28583 (mysqld)
CGroup: /system.slice/mysqld.service
└─28583 /usr/sbin/mysqld –daemonize –pid-file=/var/run/mysqld/mysqld.pid
Dec 23 12:02:42 cdh1-172-17-4-9 systemd[1]: Starting MySQL Server…
Dec 23 12:02:52 cdh1-172-17-4-9 systemd[1]: Started MySQL Server.
[aiot@cdh1-172-17-4-9 aiot]$ sudo grep ‘temporary password’ /var/log/mysqld.log
2019-12-23T04:02:49.050303Z 1 [Note] A temporary password is generated for root@localhost: JwXY&drNk6l0
[aiot@cdh1-172-17-4-9 aiot]$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.20-log
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

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
mysql> ALTER USER USER() IDENTIFIED BY 'passwd!@$';
Query OK, 0 rows affected (0.00 sec)

grant all privileges on *.* to 'root'@'%' identified by 'Aiot2019!@$' with grant option;
create database scm DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create database hive DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create database oozie DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create database hue DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create database nas DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create database actmonitor DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create database rptmgn DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create database navmetas DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
create database sentry DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
grant all privileges on *.* to 'admin'@'%' identified by 'Aiot2019!@$' with grant option;
grant all privileges on scm.* to 'scm'@'%' identified by 'Aiot2019!@$' with grant option;
grant all privileges on hive.* to 'hive'@'%' identified by 'Aiot2019!@$' with grant option;
grant all privileges on oozie.* to 'oozie'@'%' identified by 'Aiot2019!@$' with grant option;
grant all privileges on hue.* to 'hue'@'%' identified by 'Aiot2019!@$' with grant option;
grant all privileges on nas.* to 'nas'@'%' identified by 'Aiot2019!@$' with grant option;
grant all privileges on actmonitor.* to 'actmonitor'@'%' identified by 'Aiot2019!@$' with grant option;
grant all privileges on rptmgn.* to 'rptmgn'@'%' identified by 'Aiot2019!@$' with grant option;
grant all privileges on navmetas.* to 'navmetas'@'%' identified by 'Aiot2019!@$' with grant option;
grant all privileges on sentry.* to 'sentry'@'%' identified by 'Aiot2019!@$' with grant option;
flush privileges;
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| actmonitor |
| hive |
| hue |
| mysql |
| nas |
| navmetas |
| oozie |
| performance_schema |
| rptmgn |
| scm |
| sentry |
| sys |
+--------------------+
13 rows in set (0.00 sec)

#####配置httpd(主节点):

[aiot@cdh1-172-17-4-9 aiot]$ sudo vim /etc/httpd/conf/httpd.conf

1
2
3
4
5
6
7
8
9
找到增加 .parcel
AddType application/x-gzip .gz .tgz .parcel
找到修改:
<Directory "/var/www/cgi-bin">
AllowOverride None
Options FollowSymLinks
Order deny,allow
allow from all
</Directory>

[aiot@cdh1-172-17-4-9 aiot]$ sudo systemctl start httpd
[aiot@cdh1-172-17-4-9 aiot]$ sudo systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: active (running) since Mon 2019-12-23 12:23:22 CST; 2min 18s ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 31242 (httpd)
Status: “Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec”
CGroup: /system.slice/httpd.service
├─31242 /usr/sbin/httpd -DFOREGROUND
├─31243 /usr/sbin/httpd -DFOREGROUND
├─31244 /usr/sbin/httpd -DFOREGROUND
├─31245 /usr/sbin/httpd -DFOREGROUND
├─31246 /usr/sbin/httpd -DFOREGROUND
└─31247 /usr/sbin/httpd -DFOREGROUND
Dec 23 12:23:22 cdh1-172-17-4-9 systemd[1]: Starting The Apache HTTP Server…
Dec 23 12:23:22 cdh1-172-17-4-9 httpd[31242]: AH00558: httpd: Could not reliably determine the server’s fully qua…ssage
Dec 23 12:23:22 cdh1-172-17-4-9 systemd[1]: Started The Apache HTTP Server.
Hint: Some lines were ellipsized, use -l to show in full.
[aiot@cdh1-172-17-4-9 aiot]$ sudo systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.

#####搭建本地仓库(海外服务器很快(主节点):)

1
2
3
4
5
6
7
8
9
10
sudo wget --recursive --no-parent --no-host-directories https://archive.cloudera.com/cdh6/6.2.0/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373-el7.parcel -P /var/www/html/cloudera-repos
sudo wget --recursive --no-parent --no-host-directories https://archive.cloudera.com/cdh6/6.2.0/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373-el7.parcel.sha1 -P /var/www/html/cloudera-repos
sudo wget --recursive --no-parent --no-host-directories https://archive.cloudera.com/cdh6/6.2.0/parcels/CDH-6.2.0-1.cdh6.2.0.p0.967373-el7.parcel.sha256 -P /var/www/html/cloudera-repos
sudo wget --recursive --no-parent --no-host-directories https://archive.cloudera.com/cdh6/6.2.0/parcels/manifest.json -P /var/www/html/cloudera-repos
sudo wget --recursive --no-parent --no-host-directories https://archive.cloudera.com/gplextras6/6.2.0/parcels/ -P /var/www/html/cloudera-repos
sudo wget --recursive --no-parent --no-host-directories https://archive.cloudera.com/cm6/6.2.0/redhat7/ -P /var/www/html/cloudera-repos
sudo wget https://archive.cloudera.com/cm6/6.2.0/allkeys.asc -P /var/www/html/cloudera-repos/cm6/6.2.0/
sudo wget https://archive.cloudera.com/cm6/6.2.0/cloudera-manager-installer.bin -P /var/www/html/cloudera-repos/cm6/6.2.0/
sudo wget --recursive --no-parent --no-host-directories https://archive.cloudera.com/kafka/parcels/4/ -P /var/www/html/cloudera-repos
sudo wget --recursive --no-parent --no-host-directories http://archive.cloudera.com/sqoop-connectors/parcels/latest/ -P /var/www/html/cloudera-repos

[aiot@cdh2-172-17-4-10 ~]$ sudo chmod -R ugo+rX /var/www/html/cloudera-repos/cdh6
[aiot@cdh2-172-17-4-10 ~]$ sudo chmod -R ugo+rX /var/www/html/cloudera-repos/gplextras6
[aiot@cdh2-172-17-4-10 ~]$ sudo chmod -R ugo+rX /var/www/html/cloudera-repos/cm6
[aiot@cdh2-172-17-4-10 ~]$ sudo chmod -R ugo+rX /var/www/html/cloudera-repos/kafka
[aiot@cdh2-172-17-4-10 ~]$ sudo chmod -R ugo+rX /var/www/html/cloudera-repos/sqoop-connectors

#####配置本地yum源(所有节点,源指向主节点):
[aiot@cdh1-172-17-4-9 ~]$ cat /etc/yum.repos.d/cloudera-manager6.2.0.repo

1
2
3
4
5
6
7
8
[cloudera-manager]
name=Cloudera Manager 6.2.0
baseurl=http://172.17.4.9/cloudera-repos/cm6/6.2.0/redhat7/yum/
gpgkey=http://172.17.4.9/cloudera-repos/cm6/6.2.0/redhat7/yum/RPM-GPG-KEY-cloudera
gpgcheck=1
enabled=1
autorefresh=0
type=rpm-md

[aiot@cdh1-172-17-4-9 ~]$ cat /etc/yum.repos.d/cloudera-manager-gplextras6.2.0.repo

1
2
3
4
5
6
7
8
[cloudera-manager-gplextras]
name=Cloudera Manager gplextras 6.2.0
baseurl=http://172.17.4.9/cloudera-repos/gplextras6/6.2.0/redhat7/yum/
gpgkey=http://172.17.4.9/cloudera-repos/gplextras6/6.2.0/redhat7/yum/RPM-GPG-KEY-cloudera
gpgcheck=1
enabled=1
autorefresh=0
type=rpm-md

sudo wget –recursive –no-parent –no-host-directories http://archive.cloudera.com/gplextras6/6.2.0/redhat7/yum/repodata/ -P /var/www/html/cloudera-repos

[aiot@cdh1-172-17-4-9 ~]$ sudo yum clean all
[aiot@cdh1-172-17-4-9 ~]$ sudo yum makecache
#####更新系统
[aiot@cdh1-172-17-4-9 ~]$ sudo yum update

#####安装cloudera
[aiot@cdh1-172-17-4-9 ~]$ sudo yum -y search cloudera-manager

1
2
3
4
5
6
7
8
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
============================================= N/S matched: cloudera-manager =============================================
cloudera-manager-agent.x86_64 : The Cloudera Manager Agent
cloudera-manager-daemons.x86_64 : Provides daemons for monitoring Hadoop and related tools.
cloudera-manager-server.x86_64 : The Cloudera Manager Server
cloudera-manager-server-db-2.x86_64 : Embedded database for the Cloudera Manager Server
Name and summary matches only, use "search all" for everything.

[aiot@cdh1-172-17-4-9 ~]$ sudo yum install cloudera-manager-daemons cloudera-manager-server
[aiot@cdh1-172-17-4-9 ~]$ sudo -E /opt/cloudera/cm/schema/scm_prepare_database.sh mysql scm scm ‘Aiot2019!@$’
···
JAVA_HOME=/usr/java/jdk
Verifying that we can write to /etc/cloudera-scm-server
Creating SCM configuration file in /etc/cloudera-scm-server
Executing: /usr/java/jdk/bin/java -cp /usr/share/java/mysql-connector-java.jar:/usr/share/java/oracle-connector-java.jar:/usr/share/java/postgresql-connector-java.jar:/opt/cloudera/cm/schema/../lib/* com.cloudera.enterprise.dbutil.DbCommandExecutor /etc/cloudera-scm-server/db.properties com.cloudera.cmf.db.
Mon Dec 23 15:24:48 CST 2019 WARN: Establishing SSL connection without server’s identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn’t set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to ‘false’. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
[ main] DbCommandExecutor INFO Successfully connected to database.
All done, your SCM database is configured correctly!
···

[aiot@cdh1-172-17-4-9 ~]$ sudo mkdir -p /data/cloudera/parcels
[aiot@cdh1-172-17-4-9 ~]$ sudo chown -R cloudera-scm:cloudera-scm /data/cloudera/parcels
[aiot@cdh1-172-17-4-9 ~]$ sudo chown -R cloudera-scm:cloudera-scm /data/cloudera
[aiot@cdh1-172-17-4-9 ~]$ sudo mkdir -p /data/cloudera/parcel-repo
[aiot@cdh1-172-17-4-9 ~]$ sudo chown -R cloudera-scm:cloudera-scm /data/cloudera/parcel-repo
[aiot@cdh1-172-17-4-9 ~]$ sudo chown -R cloudera-scm:cloudera-scm /data/cloudera
[aiot@cdh1-172-17-4-9 ~]$ sudo mkdir -p /data/cloudera/parcel-cache
[aiot@cdh1-172-17-4-9 ~]$ sudo chown -R cloudera-scm:cloudera-scm /data/cloudera/parcel-cache
[aiot@cdh1-172-17-4-9 ~]$ sudo chown -R cloudera-scm:cloudera-scm /data/cloudera/

[aiot@cdh1-172-17-4-9 ~]$ sudo systemctl start cloudera-scm-server
[aiot@cdh1-172-17-4-9 ~]$ sudo systemctl status cloudera-scm-server
[aiot@cdh1-172-17-4-9 ~]$ sudo tail -f /var/log/cloudera-scm-server/cloudera-scm-server.log

1
2019-12-23 15:26:22,723 INFO WebServerImpl:com.cloudera.server.cmf.WebServerImpl: Started Jetty server.