CDH实操--集群卸载
1、停止正在运行的服务
a、控制台停止集群服务
b、控制台停止Cloudera Management Service
c、命令行停止cm服务
systemctl stop cloudera-scm-agent #所有节点执行 systemctl stop cloudera-scm-server #cdh01节点执行
2、主线并移除Parcles
rm -rf /opt/cloudera
3、卸载Cloudera Manager Server
/usr/share/cmf/uninstall-cloudera-manager.sh
注:若集群中未安装uninstall-cloudera-manager.sh,则使用下面命令进行卸载
yum remove cloudera-manager-server y
4、在所有Agent主机上,卸载CDH及Clouder Manager Agent
yum remove cloudera-manager-* y
运行下面清楚命令:
yum clean all
5、在所有的Agent主机上行,删除所有的Cloudera Manager数据
( 若考虑以后访问,需要将这些数据备份,若使用了内嵌的数据库PostgreSQL数据库,数据存储在/var/lib/cloudear-scm-server-db)
rm -rf /dfs /usr/share/cmf /var/lib/cloudera* /var/cache/yum/x86_64/var/run/cloudera* /var/log/cloudera-scm-* 卸载mouont目录(一次卸载不了可以多试两次) umount /run/cloudera-scm-agent/process rm -rf /run/cloudera-scm-agent
6、在所有的Agent主机上,杀死运行的Cloudera Manager和Hadoop进程
一般在第一步hadoop已经停了,就不需要此步骤
ps -ef | grep 'hadoop' | grep -v 'grep'| awk '{print \$2}' ps -ef | grep 'mapreduce' | grep -v 'grep'| awk '{print \$2}' ps -ef | grep 'yarn' | grep -v 'grep'| awk '{print \$2}' ps -ef | grep 'hbase' | grep -v 'grep'| awk '{print \$2}' ps -ef | grep 'hue' | grep -v 'grep'| awk '{print \$2}' ps -ef | grep 'hive' | grep -v 'grep'| awk '{print \$2}' ps -ef | grep 'imapla' | grep -v 'grep'| awk '{print \$2}' ps -ef | grep 'flume ' | grep -v 'grep'| awk '{print \$2}' ps -ef | grep 'kudu ' | grep -v 'grep'| awk '{print \$2}' ps -ef | grep 'kafka' | grep -v 'grep'| awk '{print \$2}'
7、删除Cloudera Manager锁
rm -rf /tmp/.scm_prepare_node.lock #若没有此对应锁文件则不需此步骤 最好把/tmp目录下的所有有关cloudera manager的临时文件删除 rm -rf /tmp/cmf* /tmp/scm*
8、如果是自建的数据库,则进行删除
DROP DATABASE amon; DROP DATABASE hue; DROP DATABASE nav; DROP DATABASE navms; DROP DATABASE oozie; DROP DATABASE rman; DROP DATABASE scm; DROP DATABASE sentry; DROP DATABASE metastore;
9、可进行内存回收(根据需要)
sync sysctl -w vm.drop_caches=3