CDH实操--CDH5.8.2升级(一)
1、摘要和概述
本次升级是从cdh5.8.2升级至cdh6.2.1,由于cm对cdh的兼容性,需要先升级cm,从5.8.2升级至至6.2.1。
2、升级CM
2.1 CM安装文件
2.2 CDH安装文件
2.3 修改本地源
# cat /etc/yum.repos.d/cm.repo # 修改内容如下(关闭旧版本源,添加新版本源)
[root@cdh01 yum.repos.d]# cat cm.repo #[cmrepo] #name = cm_repo #baseurl = http://172.16.106.151/cm5.8.2 #enable = true #gpgcheck = false [cm621] name=Cloudera Manager 621 baseurl=http://172.16.106.151/cm6.2.1/ gpgcheck=1 enabled=1 gpgkey=http://172.16.106.151/cm6.2.1/RPM-GPG-KEY-cloudera [root@cdh01 yum.repos.d]#
检查所有节点的yum文件是否一致
2.4 升级辅助脚本
[root@cdh01 mnt]# cat cm_backup.sh #!/bin/bash export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/root/bin" export CM_BACKUP_DIR=/data/cm_backup_"`date +%F`-cm5.8.2" mkdir -p $CM_BACKUP_DIR test -f $CM_BACKUP_DIR/cloudera-scm-agent.tar || tar -cf $CM_BACKUP_DIR/cloudera-scm-agent.tar --exclude=*.sock /etc/cloudera-scm-agent /etc/default/cloudera-scm-agent /var/run/cloudera-scm-agent /var/lib/cloudera-scm-agent [root@cdh01 mnt]#
2.5 备份CM
2.5.1 将cm备份脚本同步至集群所有节点并执行
2.5.2 停止CM(Cloudera Manager Server)和CMS(Cloudera Management Service)
停止CMS
服务器端停止后台服务:
[root@cdh01 mnt]# systemctl stop cloudera-scm-server [root@cdh01 mnt]# xcall.sh "systemctl stop cloudera-scm-agent" ============= cdh01 systemctl stop cloudera-scm-agent ============= ============= cdh02 systemctl stop cloudera-scm-agent ============= ============= cdh03 systemctl stop cloudera-scm-agent ============= [root@cdh01 mnt]#
确认agent后台关闭:
2.5.3 备份CM数据库
[root@cdh01 mnt]# mysqldump --databases scm --port=3306 -uroot -p123456 --events -l -F -e -R > scm_$(date +%F).sql mysqldump: [Warning] Using a password on the command line interface can be insecure. [root@cdh01 mnt]#
2.5.4 备份CM服务端相关配置文件
[root@cdh01 mnt]# export CM_BACKUP_DIR=/data/cm_backup_"`date +%F`-cm5.8.2" [root@cdh01 mnt]# echo $CM_BACKUP_DIR /data/cm_backup_2022-05-26-cm5.8.2 [root@cdh01 mnt]# tar -cf $CM_BACKUP_DIR/cloudera-scm-server.tar /etc/cloudera-scm-server /etc/default/cloudera-scm-server
查看备份文件: