Cloudera Manager还是比较耗资源的,想把Cloudera Manager,移动到比较好的机器上。
cdh的安装请参考:cloudera cdh 6.3 安装配置
在这篇文章中,Cloudera Manager安装在bigserver1上面,bigserver1是奔腾双核的CPU。
1,Cloudera Manager占资源比较多
停止cdh,以及cloudera manager
2,从bigserver1导出数据库,copy到新机器
# mysqldump -u cdh6 -pCdh6_123 scm -h 10.0.40.237 > scm.sql # mysqldump -u cdh6 -pCdh6_123 amon -h 10.0.40.237 > amon.sql # mysqldump -u cdh6 -pCdh6_123 rman -h 10.0.40.237 > rman.sql # mysqldump -u cdh6 -pCdh6_123 hue -h 10.0.40.237 > hue.sql # mysqldump -u cdh6 -pCdh6_123 metastore -h 10.0.40.237 > metastore.sql # mysqldump -u cdh6 -pCdh6_123 sentry -h 10.0.40.237 > sentry.sql # mysqldump -u cdh6 -pCdh6_123 nav -h 10.0.40.237 > nav.sql # mysqldump -u cdh6 -pCdh6_123 navms -h 10.0.40.237 > navms.sql # mysqldump -u cdh6 -pCdh6_123 oozie -h 10.0.40.237 > oozie.sql # scp *.sql root@bigserver5:/root/cdh6/
3,在bigserver5(新机器)创建数据并导入
CREATE DATABASE scm DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; use scm; source /root/cdh6/scm.sql; CREATE DATABASE amon DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; use amon; source /root/cdh6/amon.sql; CREATE DATABASE rman DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; use rman; source /root/cdh6/rman.sql; CREATE DATABASE hue DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; use hue; source /root/cdh6/hue.sql; CREATE DATABASE metastore DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; use metastore; source /root/cdh6/metastore.sql; CREATE DATABASE sentry DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; use sentry; source /root/cdh6/sentry.sql; CREATE DATABASE nav DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; use nav; source /root/cdh6/nav.sql; CREATE DATABASE navms DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; use navms; source /root/cdh6/navms.sql; CREATE DATABASE oozie DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; use oozie; source /root/cdh6/oozie.sql; grant all privileges on *.* TO cdh6@'10.%' IDENTIFIED BY 'Cdh6_123'; flush privileges;
第二,第三步,非必须。把数据库放在bigserver1(老机器)也是可以的。
4,bigserver5新机器安装cloudera-manager-server
# yum clean all && yum makecache # yum install cloudera-manager-daemons cloudera-manager-agent cloudera-manager-server
这里的bigserver5,是集群中新增的一个datanode节点,怎么添加节点,请参考:cdh6 增加 datanode
5,将bigserver1文件同步到bigserver5
# scp -r /var/lib/cloudera-scm-server/* root@bigserver5:/var/lib/cloudera-scm-server/ # chown -R cloudera-scm:cloudera-scm /var/lib/cloudera-scm-server/ # scp -r /opt/cloudera/parcel-repo root@bigserver5:/opt/cloudera/ # chown -R cloudera-scm:cloudera-scm /opt/cloudera/parcel-repo
5,bigserver5上面,创建数据库配置
[root@bigserver5 ~]# /opt/cloudera/cm/schema/scm_prepare_database.sh -h bigserver5 mysql scm cdh6 Cdh6_123 JAVA_HOME=/usr/local/jdk1.8.0_231 Verifying that we can write to /etc/cloudera-scm-server Creating SCM configuration file in /etc/cloudera-scm-server Executing: /usr/local/jdk1.8.0_231/bin/java -cp :/opt/cloudera/cm/schema/../lib/* com.cloudera.enterprise.dbutil.DbCommandExecutor /etc/cloudera-scm-server/db.properties com.cloudera.cmf.db. [ main] DbCommandExecutor INFO Unable to find JDBC driver for database type: MySQL [ main] DbCommandExecutor ERROR JDBC Driver com.mysql.jdbc.Driver not found. [ main] DbCommandExecutor ERROR Exiting with exit code 3 --> Error 3, giving up (use --force if you wish to ignore the error)
找不到mysql的jar包,/opt/cloudera/cm/schema/../lib/* ,根bigserver1上面的mysql-connector-java.jar包位置不一样。
解决办法:
# wget https://cdn.mysql.com//archives/mysql-connector-java-5.1/mysql-connector-java-5.1.47.tar.gz # tar zxvf mysql-connector-java-5.1.47.tar.gz # cd mysql-connector-java-5.1.47 # cp mysql-connector-java-5.1.47-bin.jar /opt/cloudera/cm/lib/mysql-connector-java.jar
注意:mysql-connector-java不要带有版本号。
6,在bigserver5启动Cloudera Management Service
# systemctl start cloudera-scm-server
如果用新的数据库,需要改数据连接,所有组件都要改
如果报:不能测试状态不佳的主机的数据库连接。
解决办法:
# cd /var/lib/cloudera-scm-agent/ # rm -f cm_guid # service cloudera-scm-agent restart
Cloudera Management Service启动后,在启动cdh,至此迁移结束。
转载请注明
作者:海底苍鹰
地址:http://blog.51yip.com/hadoop/2311.html