阿里云CentOS7.2卸载CDH5.12

时间:2021-05-28 00:23:06

#####################删除前最好将之前的下载的rpm包和parcels包备份一下#####################

1.停止service
service cloudera-scm-agent stop
service cloudera-scm-server stop

2.暴力停止service,杀进程,【run 2 times】
kill -9 $(pgrep -f cloudera-scm)
kill -9 $(pgrep -f supervisord)
ps -ef|grep cloudera-scm
ps -ef|grep supervisord

3.卸载/var/run/cloudera-scm-agent/process
umount /var/run/cloudera-scm-agent/process

#lsof /var/run/cloudera-scm-agent/process
#kill -9 PID
#kill -9 $(lsof /var/run/cloudera-scm-agent/process|awk '{print $2}')

4.卸载安装包 【2 times】
rpm -qa | grep cloudera

for f in `rpm -qa | grep cloudera`;
do
rpm -e --nodeps ${f} ;
done

rpm -qa | grep cloudera

5.删除Cloudera Manager数据 、数据库存放路径、Cloudera Manager Lock 文件、用户数据、清除安装文件
rm -rf /usr/share/cmf /var/lib/cloudera* /var/cache/yum/cloudera* /var/log/cloudera* /var/run/cloudera*
rm -rf /var/lib/cloudera-scm-server-db
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
rm -rf /etc/cloudera*
rm -rf /var/cache/yum/x86_64/7/cloudera*

rm -rf /var/lib/hadoop-* /var/lib/impala /var/lib/solr /var/lib/zookeeper /var/lib/hue /var/lib/oozie /var/lib/pgsql
rm -rf /var/lib/sqoop2 /data/dfs/ /data/impala/ /data/yarn/ /dfs/ /impala/ /yarn/
rm -rf /var/run/hadoop-*/ /var/run/hdfs-*/ /usr/bin/hadoop* /usr/bin/zookeeper* /usr/bin/hbase*
rm -rf /usr/bin/hive* /usr/bin/hdfs /usr/bin/mapred /usr/bin/yarn /usr/bin/sqoop* /usr/bin/oozie
rm -rf /etc/hadoop* /etc/zookeeper* /etc/hive* /etc/hue /etc/impala /etc/sqoop* /etc/oozie /etc/hbase* /etc/hcatalog
rm -rf /var/run/zookeeper
rm -rf /tmp/scm_prepare_node* /tmp/.scm_prepare_node.lock
rm -rf /var/lib/hbase /var/lib/spark /var/lib/hive

6.删除parcel 包分发文件和解压文件

rm -rf /tmp/A* /tmp/cmf* /tmp/J* /tmp/jffi* /tmp/q* /tmp/scm*
rm -rf /opt/cloudera

7.执行失效软连接
ls -l /etc/alternatives | grep -E 'CDH|cloudera' | awk '{print $9}' | while read line; do rm -rf /etc/alternatives/$line ; done

agent安装过程注意点:
a./etc/hosts文件
b.防火墙
c.端口
d.卸载要干净(所以要对配置文件的路径了如指掌)
e.yum源配置(epel) http://blog.itpub.net/30089851/viewspace-2130239/

最后因为是自己需要完全重装,连mysql数据库也drop掉了

阿里云CentOS7.2卸载CDH5.12