作者:无情云南_132 | 来源:互联网 | 2023-06-03 18:59
1.在ClouderaManager控制台停止所有服务:2.停止ClouderaManagerservice3.移除parcel包假如是通过packages来安装的
1.在Cloudera Manager控制台停止所有服务:
2. 停止Cloudera Manager service
3. 移除parcel包
假如是通过 packages 来安装的,那么请跳过这个步骤。本文是针对parcel包方式进行安装。
在CM界面右上角点击Parcel包的图标:
在页面右边点击停用CDH5,”停用”对于英文(Deactive)
4.停止Server和Client服务
rpm包安装方式执行以下命令:
在master节点执行以下命令:
systemctl stop cloudera-scm-agent
systemctl stop cloudera-scm-server
在每个slave节点执行以下命令:
systemctl stop cloudera-scm-agent
完全离线方式安装执行(执行过程同上):
/opt/cm-5.14.2/etc/init.d/cloudera-scm-server stop
/opt/cm-5.14.2/etc/init.d/cloudera-scm-agent stop
5. 暴力杀进程(每个节点都需要执行)
ps -ef | grep cloudera | grep -v grep | cut -b10-15 | xargs kill -9
ps -ef | grep supervisord | grep -v grep | cut -b10-15 | xargs kill -9
6. 卸载/var/run/cloudera-scm-agent/process
rpm包安装方式执行
在master节点执行:
umount /var/run/cloudera-scm-agent/process
umount /var/run/cloudera-scm-server/process
在每个slave节点执行:
umount /var/run/cloudera-scm-agent/process
完全离线安装执行(执行步骤同上)
umount /opt/cm-5.14.2/run/cloudera-scm-agent/process
umount /opt/cm-5.14.2/run/cloudera-scm-server/process
7. 卸载安装包(每个节点执行)
rpm包安装的执行:
rpm -qa | grep cloudera | xargs rpm -e --nodeps
完全离线安装的则跳过此步骤
8. 在每个节点删除相应文件夹和数据目录
删除Cloudera Manager数据 、数据库存放路径、Cloudera Manager Lock 文件、用户数据、清除安装文件 (安装方式不一样,可能配置文件路径不一样,删除时候注意,小心删错别的文件,安装的服务不一样,可能涉及到的文件路径有差别,以下是默认路径),将以下语句保存到removeALL.sh脚本里并分发到各个节点执行:
for i in {7..10};
dossh 10.10.1.$i "rm -rf /usr/share/cmf /var/lib/cloudera* /var/cache/yum/cloudera* /var/log/cloudera* /var/run/cloudera* /etc/alternatives/yarn*; rm -rf /var/lib/cloudera-scm-server-db /etc/alternatives/sentry* /etc/alternatives/solr*; rm -rf /tmp/.scm_prepare_node.lock /tmp/hsperfdata_hadoop /tmp/hsperfdata_hdfs /tmp/hsperfdata_mapred /tmp/hsperfdata_zookeeper /tmp/hsperfdata_cloudera-scm /tmp/hadoop-root; rm -rf /var/lib/flume-ng /var/lib/hadoop* /var/lib/hue /var/lib/navigator /var/lib/oozie /var/lib/solr /var/lib/sqoop* /var/lib/zookeeper; rm -rf /dfs /mapred /yarn /etc/alternatives/avro* /etc/alternatives/beeline*; rm -rf /etc/cloudera* /etc/alternatives/bigtop* /etc/alternatives/catalogd* /etc/alternatives/cli_* /etc/alternatives/hue* /etc/alternatives/sqoop*; rm -rf /var/cache/yum/x86_64/7/cloudera* /etc/alternatives/llama* /etc/alternatives/*spark* /etc/alternatives/pig* /etc/alternatives/mahout*; rm -rf /var/lib/hadoop-* /var/lib/impala /var/lib/solr /var/lib/zookeeper /var/lib/hue /var/lib/oozie /var/lib/pgsql /etc/alternatives/impala*; rm -rf /var/lib/sqoop2 /data/dfs/ /data/impala/ /data/yarn/ /dfs/ /impala/ /yarn/ /etc/alternatives/oozie* /etc/alternatives/mapred* /etc/alternatives/mahout*; rm -rf /var/run/hadoop-*/ /var/run/hdfs-*/ /usr/bin/hadoop* /usr/bin/zookeeper* /usr/bin/hbase* /etc/alterniatives/hadoop* /etc/alternatives/hbase*; rm -rf /usr/bin/hive* /usr/bin/hdfs /usr/bin/mapred /usr/bin/yarn /usr/bin/sqoop* /usr/bin/oozie /etc/alternatives/hcat* /etc/alternatives/hdfs*; rm -rf /etc/hadoop* /etc/zookeeper* /etc/hive* /etc/hue /etc/impala /etc/sqoop* /etc/oozie /etc/hbase* /etc/hcatalog /etc/alternatives/hive*; rm -rf /var/run/zookeeper /etc/alternatives/flume* /etc/alternatives/zookeeper* /etc/alternatives/parquet* /etc/alternatives/whirr; rm -rf /tmp/scm_prepare_node* /tmp/.scm_prepare_node.lock /etc/alternatives/bigtop* /etc/alternatives/yarn*"
done
9. 删除parcel 包分发文件和解压文件(每个节点执行)
rm -rf /tmp/A* /tmp/cmf* /tmp/J* /tmp/jffi* /tmp/q* /tmp/scm* /opt/cloudera/*
10.删除/opt目录下cloudera相关文件(每个节点执行)
rm -rf /opt/cloudera*