CDH5.16.2部署
CDH部署
Centos7中安装CDH-5.16.2
hostname | ip |
---|---|
node1 | |
node2 | |
node3 |
下载安装包
仅node1节点执行
CDH-5.16.2-1.cdh5.16.2.p0.8-el7.parcel
CDH-5.16.2-1.cdh5.16.2.p0.8-el7.parcel.sha
cloudera-manager-centos7-cm5.16.2_x86_64.tar.gz
manifest.json
mysql-connector-java-5.1.46-bin.jar
安装jdk
略
关闭防火墙
所有节点执行
systemctl stop firewalld
关闭selinux
set enforce 0 (临时生效)
修改 vim /etc/selinux/config 下的
SELINUX=disabled (重启后永久生效)
安装mysql
仅一台服务器执行,以node1为例
https://www.jianshu.com/p/8c596b08b90e?v=1688637409730
ntpd服务
所有节点执行
ntpdate -u node1
网络配置
配置三台服务器互相免密
所有节点执行,node1为为例
vim /etc/hostname
node1
每台服务器添加
172.17.134.226 node1
172.17.134.227 node2
172.17.134.228 node3
设置免密,每台执行
ssh-keygen -t rsa
ssh-copy-id root@node1
ssh-copy-id root@node2
ssh-copy-id root@node3
如果找不到该命令 ssh-copy-id,手动复制公钥
或者其余方法,达到免密效果即可
cat ~/.ssh/id_rsa.pub
#目标服务器
touch ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
安装Cloudera Manager
安装前先保证机器上安装了python,不过一般centos7都默认安装了python2.7.5
仅node1节点执行
tar -zxvf cloudera-manager-centos7-cm5.16.2_x86_64.tar.gz -C /opt
useradd --system --home-dir /opt/cm-5.16.2/run/cloudera-scm-server/ --no-create-home --shell=/bin/false --comment "Cloudera SCM User" cloudera-scm
vim /opt/cm-5.16.2/etc/cloudera-scm-agent/config.ini
#修改server_host参数为node1节点
server_host=node1
将mysql驱动copy到/opt/cm-5.16.2/share/cmf/lib/中
cp mysql-connector-java-5.1.46-bin.jar /opt/cm-5.16.2/share/cmf/lib/
node1节点执行
scp -r /opt/cm-5.16.2/ root@node2:/opt/
scp -r /opt/cm-5.16.2/ root@node3:/opt/
node2、node3节点创建cloudera-scm用户
useradd --system --home-dir /opt/cm-5.16.2/run/cloudera-scm-server/ --no-create-home --shell=/bin/false --comment "Cloudera SCM User" cloudera-scm
node1节点初始化CM5的数据库
/opt/cm-5.16.2/share/cmf/schema/scm_prepare_database.sh mysql cm -hnode1 -uroot -pGjxx@1q2w3e4r --scm-host node1 scm
Enter SCM password:Gjxx@Ak1q2w3e
第一次初始化启动会因为权限问题报错
需要查看scm用户权限并授权
use mysql;
select host,user,plugin,authentication_string from mysql.user;
CREATE USER 'scm'@'%' IDENTIFIED WITH mysql_native_password BY '123456789';
update mysql.user set authentication_string=password('123456789') where user='scm';
参考:https://www.jianshu.com/p/8c596b08b90e?v=1688637409730
cp CDH-5.16.2-1.cdh5.16.2.p0.8-el7.parcel* /opt/cloudera/parcel-repo/
cp manifest.json /opt/cloudera/parcel-repo/
cd /opt/cloudera/parcel-repo
mv CDH-5.16.2-1.cdh5.16.2.p0.8-el7.parcel.sha1 CDH-5.16.2-1.cdh5.16.2.p0.8-el7.parcel.sha
启动server
仅node1(master)节点执行
/opt/cm-5.16.2/etc/init.d/cloudera-scm-server start
启动Agent
/opt/cm-5.16.2/etc/init.d/cloudera-scm-agent start
访问
ip:7180
admin:admin