CDH CM version 6.0.1 upgrade to the current version 6.2.0 CM (CentOS 7.x)

CDH 6.0.1 is an awkward version, then cloudera not to spark further update to 2.4 using a spark 2.2 version. But then we found 2.3 | 2.4 Update feature and a lot of bug fixes and updates a number of properties including structed streaming. And recently the latest 6.2.0 Apache phoenix will provide support in the near future. So I try to look to upgrade existing CDH and recorded.

 

CM upgrade:

1. Preparation:

The CM must first be upgraded prior to CDH minor version upgrade, the previous version of the CM backward compatible, such as version 6.0.1 can not be managed on the 6.0.1 version 6.0.1 or less able to manage smaller than the version number.

follow us into the first official document to prepare for the upgrade cm through the first page of a link reference.

And then view the current situation as well as a host system through CM CDH related commands, and fill in the above information in prepare my environment. The following steps will follow to upgrade here not to choose something incorrectly or chaos filled

View Operating System 

lsb_release -a

Metastore see the current situation of the use of CM

cat /etc/cloudera-scm-server/db.properties

 

Support for the new version of the JDK

Cloudera Enterprise Version    Supported JDK
5.3 -5.15    Oracle JDK 1.7, Oracle JDK 1.8
5.16 and higher 5.x releases    Oracle JDK 1.7, Oracle JDK 1.8, OpenJDK 1.8
6.0    Oracle JDK 1.8
6.1    Oracle JDK 1.8, OpenJDK 1.8
6.2    Oracle JDK 1.8, OpenJDK 1.8

You can see we are using version 6.2 still supports Oracle JDK1.8 so we do not need this part of the upgrade. 6.1 CM start from the beginning supported OpenJDK 1.8, which was previously not supported, but can cause a lot of problems above agent.

If the non-Oraclejdk1.8 students may need to be a lot of this process, the following contents are skipped steps to re-install the jdk, if you need to refer to more complete information, please refer to the official documentation.

 

Here are some backup data to do the work in the usual sense, if we upgrade major versions, this multi-step process should be very complicated, but be minor or maintaince level upgrades are relatively few changes will be a little easier , you need to pay attention not so much. But we still have to do a backup to cook, ensure rollback.

 

2. Backup scm associated monitoring and database components:

Backup CMA (Cloudera Manager Agent)

Creating a user-friendly environment variables, and create a backup folder a date

export CM_BACKUP_DIR = " ` date +% health-CM6.0.1 " 
echo $ CM_BACKUP_DIR 
mkdir -p $ CM_BACKUP_DIR

Backup directory information associated with CMA

sudo -E 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

Backup Installation Information Warehouse

sudo -E tar -cf $CM_BACKUP_DIR/repository.tar /etc/yum.repos.d

 

Go to the admin interface will stop scm action. Stop all normal services.

Scm scm agent and then be shut down

sudo systemctl stop cloudera-scm-server
sudo systemctl stop cloudera-scm-agent

 

Backup CMS (Cloudera Management Service) information

Backup Service monitor information

sudo cp -rp /var/lib/cloudera-service-monitor /var/lib/cloudera-service-monitor-`date +%F`-CM6.0.1

Backup Host monitor information

sudo cp -rp /var/lib/cloudera-host-monitor /var/lib/cloudera-host-monitor-`date +%F`-CM6.0.1

Event Server backup information

sudo cp -rp /var/lib/cloudera-scm-eventserver /var/lib/cloudera-scm-eventserver-`date +%F`-CM6.0.1

Backup cms information

sudo -E tar -cf $CM_BACKUP_DIR/cloudera-scm-server.tar /etc/cloudera-scm-server /etc/default/cloudera-scm-server

Scm backup database information

mysqldump --databases database_name --host=database_hostname --port=database_port -u user_name -p > $HOME/database_name-backup-`date +%F`-CM6.0.1.sql

 

3. Start the upgrade process:

Cm is the best guarantee normal exit the attention of all the circumstances, including during the upgrade process scm and cm-agent situation is stopped. To guarantee period and will not have any snapshots like the job is still running, it may cause cm to get up after the upgrade.

Before deleting all repo settings

sudo rm /etc/yum.repos.d/cloudera*manager.repo*

Add our warehouse configuration 6.2.0

[cloudera-manager]
# Packages for Cloudera Manager
name=Cloudera Manager
baseurl=https://archive.cloudera.com/cm6/6.2.0/redhat7/yum/
gpgkey=https://archive.cloudera.com/cm6/6.2.0/redhat7/yum/RPM-GPG-KEY-cloudera
gpgcheck=1

Jdk installation steps we skipped because we are already Oracle1.8 of the jdk.

Update scm

sudo yum clean all
sudo yum upgrade cloudera-manager-server cloudera-manager-daemons cloudera-manager-agent 

Then it is to wait, because if it is domestic server access cloudera services may slow, if speed is not here to wait for quite a long time demons have 1.1GB

Not recommended speed can proxychain agent in advance on before upgrading. After the upgrade is complete you can see

[root@ryze-1 yum.repos.d]# rpm -qa 'cloudera-manager-*'
cloudera-manager-daemons-6.2.0-968826.el7.x86_64
cloudera-manager-server-6.2.0-968826.el7.x86_64
cloudera-manager-agent-6.2.0-968826.el7.x86_64

 

Start upgraded our agent services and service scm

Came to this interface, if not able to come to this interface can refer to the log to do some troubleshooting

tail -f /var/log/cloudera-scm-server/cloudera-scm-server.log
tail -f /var/log/cloudera-scm-agent/cloudera-scm-agent.log
tail -f /var/log/messages

 

4. Help other machines upgraded agent:

Official offers two methods of installation.

1. The first interface is presented below may be directly above the tap, and then the same as before the installation package to perform a key installation of other machines. We recommend the use of this very convenient, but if you are not on the network can use the following method.

2. The second method is to manually following the steps above for agent version of each machine to be updated, I get to do a presentation to upgrade, if it is the same deployment could write a script on the line batch deployment.

Landing target machine

Delete the previous repo 

sudo rm /etc/yum.repos.d/cloudera*manager.repo*

Information in the directory /etc/yum.repos.d create /etc/yum.repos.d/cloudera-manager.repo upgrade files needed

[cloudera-manager]
# Packages for Cloudera Manager
name=Cloudera Manager
baseurl=https://archive.cloudera.com/cm6/6.2.0/redhat7/yum/
gpgkey=https://archive.cloudera.com/cm6/6.2.0/redhat7/yum/RPM-GPG-KEY-cloudera
gpgcheck=1

停止机器上的 agent

sudo systemctl stop cloudera-scm-agent

更新 agent packages

sudo yum clean all
sudo yum repolist
sudo yum upgrade cloudera-manager-daemons cloudera-manager-agent 

安装完成

rpm -qa 'cloudera-manager-*'
cloudera-manager-agent-6.2.0-..cm...
cloudera-manager-daemons-6.2.0-..cm...

重新启动 agent 向 cm 上报信息

sudo systemctl start cloudera-scm-agent

 

不管采用那种办法,当 agent 全部升级完毕后,使用 Host Inspector 检测所有上报机器情况。

注意在安装包的过程可能出现某些主机失败,放心 cm 会对安装失败的软件包进行回滚,我们可以等到所有都安装停下来之后刷新页面重试失败的即可。注意观察相关的日志,看是否错误是因为一些包冲突引起的,那些错误需要手动排除一下。

 

升级完成之后

进入 HOME PAGE 应该会看到很多配置上的修改,应该都是新版本 CM 对 DP 上的一些优化,重新部署相关客户端即可。

在完成了 CM 升级之后,未来几天我将会对 CDH 进行升级,到时候会再记录一下,以上。

 

  

Reference:

https://www.cloudera.com/documentation/enterprise/upgrade/topics/ug_cm_upgrade_before.html#cm_upgrade_before

https://www.cloudera.com/documentation/enterprise/upgrade/topics/ug_cdh_upgrade.html

 

Guess you like

Origin www.cnblogs.com/piperck/p/11265596.html