CDH使用之CM、CDH四、5卸載

前言:不管是CM或者CDH使用的過程當中,學習研究CDH使用、CDH升級、CM升級等等緣由而考慮卸載CMCDH,本教程使用於基於CM安裝的CDH的卸載。固然,若是CDH採用獨立安裝方式安裝,在刪除對應目錄時,更改相應目錄便可,主要分爲CM卸載和CDH卸載兩部分,理論上使用於CDH4CDH5的卸載(新版本若有更改則不適用)。node

1、卸載CM:(CM主機執行)1、移除全部服務 數據庫

       先在Cloudera Manager管理端中止集羣全部組件服務,而後刪除全部服務。緩存

二、刪除Manager Server一直選yes. 卸載不成功執行步驟3微信

       CM所安裝的主機上執行以下命令,須要root權限:app

sudo/usr/share/cmf/uninstall-cloudera-manager.shsocket

3、若是沒有該腳本,則能夠手動刪除,先中止服務: oop

         命令以下:學習

sudo service cloudera-scm-server stopspa

sudo service cloudera-scm-server-db stoppwa

sudo yum remove cloudera-manager-server

sudo yum remove cloudera-manager-server-db

2、卸載CDH:(全部主機執行)1、刪除全部CDH節點上的CDH服務

sudo service cloudera-scm-agent hard_stop

2、卸載clouderarpm

查看:

rpm -qa | grep cloudera

逐個將其刪除:

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

sudo yum remove 'cloudera-manager-*' hadoop hue-common 'bigtop-*'

3、刪除cloudera的安裝目錄

sudo rm -rf /usr/share/cmf /var/lib/cloudera* /var/cache/yum/x86_64/6/cloudera* /var/log/cloudera* /var/run/cloudera*   

**如報文件佔用錯誤,重啓機器,當即執行該命令

數據庫配置:

rm -rf /etc/cloudera*

4清理Cloudera 相關文件

         命令以下:

sudo rm -rf /var/lib/flume-ng /var/lib/hadoop* /var/lib/hue /var/lib/oozie /var/lib/solr /var/lib/sqoop*


sudo rm -rf /dfs /mapred /yarn


rm -rf /var/run/hadoop* /var/run/flume-ng* /var/run/cloudera* /var/run/oozie* /var/run/sqoop* /var/run/zookeeper* /var/run/hbase* /var/run/impala* /var/run/hive* /var/run/hdfs-sockets


rm -rf /usr/lib/hadoop /usr/lib/hadoop* /usr/lib/hive /usr/lib/hbase /usr/lib/oozie /usr/lib/sqoop* /usr/lib/zookeeper /usr/lib/bigtop* /usr/lib/flume-ng /usr/lib/hcatalog


rm -rf /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


rm -rf /etc/hadoop* /etc/zookeeper* /etc/hive* /etc/hue /etc/impala /etc/sqoop* /etc/oozie /etc/hbase* /etc/hcatalog


5、清除alternatives目錄下配置

         命令以下:

rm -rf /etc/alternatives/flume*

rm -rf /etc/alternatives/hadoop*

rm -rf /etc/alternatives/hbase*

rm -rf /etc/alternatives/hive*

rm -rf /etc/alternatives/hue*

rm -rf /etc/alternatives/impala*

rm -rf /etc/alternatives/llama*

rm -rf /etc/alternatives/oozie*

rm -rf /etc/alternatives/pig*

rm -rf /etc/alternatives/solr*

rm -rf /etc/alternatives/spark*

rm -rf /etc/alternatives/sqoop*

rm -rf /etc/alternatives/zookeeper*

6、清除上一個版本的數據(舊版本是4.*須要刪除該目錄)

命令以下:

rm -rf /var/lib/alternatives/{cdh.app}

rm -rf /var/lib/alternatives/flume*

rm -rf /var/lib/alternatives/hadoop*

rm -rf /var/lib/alternatives/hbase*

rm -rf /var/lib/alternatives/hive*

rm -rf /var/lib/alternatives/hue*

rm -rf /var/lib/alternatives/impala*

rm -rf /var/lib/alternatives/llama*

rm -rf /var/lib/alternatives/oozie*

rm -rf /var/lib/alternatives/pig*

rm -rf /var/lib/alternatives/solr*

rm -rf /var/lib/alternatives/spark*

rm -rf /var/lib/alternatives/sqoop*

rm -rf /var/lib/alternatives/zookeeper*

7、刪除日誌及緩存數據目錄

         命令以下:

tmpwatch -afv 1 /tmp

rm -rf /opt/cloudera/*

rm -rf /var/log/hadoop-*

rm -rf /var/log/hue*

rm -rf /var/log/oozie*

rm -rf /var/log/sqoop*

rm -rf /var/log/pig*

rm -rf /var/log/hive*

rm -rf /var/log/hbase*

rm -rf /var/log/zookeeper*

rm -rf /var/log/mahout*

rm -rf /var/log/impala*

rm -rf /var/log/hdfs*

rm -rf /var/lib/hdfs*

rm -rf /var/lib/alternatives/hdfs*

rm -rf /var/run/hdfs*

rm -rf /etc/hdfs*

rm -rf /etc/alternatives/hdfs*

rm -rf /usr/bin/hdfs*

rm -rf /var/run/hdfs*

rm -rf /var/log/yarn*

rm -rf /var/log/whirr*

rm -rf /var/log/mapred*

rm -rf /var/lib/mapred*

rm -rf /var/lib/alternatives/mapred*

rm -rf /var/run/mapred*

rm -rf /etc/mapred*

rm -rf /etc/alternatives/mapred*

rm -rf /usr/bin/mapred*

rm -rf /var/run/mapred*

8殺死相關的進程

for u in hdfs mapred cloudera-scm hbase hue zookeeper oozie hive impala flume spark; do sudo kill $(ps -u $u -o pid=); done

9刪除 Cloudera Managerlock file

sudo rm /tmp/.scm_prepare_node.lock

10刪除parcel 包分發文件和解壓文件

rm -rf /opt/cloudera/parcel-cache /opt/cloudera/parcels

更多精彩內容請關注:http://bbs.superwu.cn

關注超人學院微信二維碼:

相關文章
相關標籤/搜索