本文通过实践过程详细描述卸载CDH 5.X的一般步骤。
1 通过Cloudera Manager UI关闭集群所有服务。
URL:http://Cloudera_Manager_Ip:7180/cmf/home
2 通过Cloudera Manager UI删除集群。
3 停止并删除Cloudera Manager服务。
此时Web UI应该是这样的,
4 卸载Cloudera Manager。
[centos@cent-1 ~]$ sudo yum remove cloudera-manager-server
[centos@cent-1 ~]$ sudo yum remove cloudera-manager-server-db
(注:如果集群中有/usr/share/cmf/uninstall-cloudera-manager.sh也可直接执行/usr/share/cmf/uninstall-cloudera-manager.sh)
5 停止cloudera-scm-agent服务及cloudera-scm-server服务。
[centos@cent-1 ~]$ sudo service cloudera-scm-agent status
cloudera-scm-agent (pid 18608) is running...
[centos@cent-1 ~]$ sudo service cloudera-scm-agent stop
Stopping cloudera-scm-agent:
[centos@cent-1 ~]$ sudo service cloudera-scm-agent status
cloudera-scm-agent is stopped
[centos@cent-1 ~]$ sudo service cloudera-scm-server status
cloudera-scm-server (pid 18315) is running...
[centos@cent-1 ~]$ sudo service cloudera-scm-server stop
Stopping cloudera-scm-server:
[centos@cent-1 ~]$ sudo service cloudera-scm-server status
cloudera-scm-server is stopped
6 执行清除工作(每台机器)
[centos@cent-1 ~]$ sudo umount /var/run/cloudera-scm-agent/process
7 卸载安装包(每台机器)
[centos@cent-1 process]$ rpm -qa | grep cloudera
cloudera-manager-daemons-5.4.9-1.cm549.p0.9.el6.x86_64
cloudera-manager-agent-5.4.9-1.cm549.p0.9.el6.x86_64
[centos@cent-1 ~]$ sudo rpm -e cloudera-manager-agent-5.4.9-1.cm549.p0.9.el6.x86_64
warning: /etc/cloudera-scm-agent/config.ini saved as /etc/cloudera-scm-agent/config.ini.rpmsave
[centos@cent-1 ~]$ sudo rpm -e cloudera-manager-daemons-5.4.9-1.cm549.p0.9.el6.x86_64
[centos@cent-1 ~]$ rpm -qa | grep cloudera
8 清除安装文件(每台机器)
[centos@cent-1 ~]$ sudo rm -rf /var/lib/hadoop-* /var/lib/impala /var/lib/solr /var/lib/zookeeper /var/lib/hue /var/lib/oozie /var/lib/pgsql /var/lib/sqoop2 /data/dfs/ /data/impala/ /data/yarn/ /dfs/ /impala/ /yarn/ /var/run/hadoop-*/ /var/run/hdfs-*/ /usr/bin/hadoop* /usr/bin/zookeeper* /usr/bin/hbase* /usr/bin/hive* /usr/bin/hdfs /usr/bin/mapred /usr/bin/yarn /usr/bin/sqoop* /usr/bin/oozie /etc/hadoop* /etc/zookeeper* /etc/hive* /etc/hue /etc/impala /etc/sqoop* /etc/oozie /etc/hbase* /etc/hcatalog
9 Kill相关进程(每台机器)
[centos@cent-1 alternatives]$ for u in hdfs mapred cloudera-scm hbase hue zookeeper oozie hive impala flume; do sudo kill $(ps -u $u -o pid=); done
10 删除pacel包分发文件和解压文件(每台机器)
[centos@cent-1 ~]$ sudo rm -rf /opt/cloudera/parcel-cache /opt/cloudera/parcels