Hadoop建设工具Ambari的安装部署及完整使用(五)——Ambari使用之集群卸载

五.Ambari使用——卸载集群


方式一:

ambari本身并没有提供基于web管理端的自动化卸载的功能。ambari web管理端的操作更多的是实现服务或是主机的扩展(无法完全清除服务和主机)。因此本人通过实践,也整理了一份手动卸载脚本:

注:因为此脚本只是根据作者实践以及其它网络资料整理而成,所以脚本内容一定不全(官方方式请参见方法二)。但是各位看官稍微了解ambari的安装目录结构即可进一步完善。其本质就是把所涉及的无论是用户,安装包,运行目录,数据存储的目录及其目录下的内容全部删除。如果无法确定能否一次性删除干净也没关系,在之前介绍的集群部署的第六步检查各个主机注册情况时,未及时清理掉的内容都会以警告的形式提示出来,使用者只需根据提示执行删除操作即可。

ambari-agent stop 
yum remove hadoop_2* hdp-select* ranger_2* zookeeper_* bigtop* atlas-metadata* ambari* postgresql spark*  slider* storm* snappy* -y
userdel oozie  
userdel hive  
userdel ambari-qa  
userdel flume    
userdel hdfs    
userdel knox    
userdel storm    
userdel mapred  
userdel hbase    
userdel tez    
userdel zookeeper  
userdel kafka    
userdel falcon  
userdel sqoop    
userdel yarn    
userdel hcat  
userdel atlas  
userdel spark  
userdel ams

rm -rf /home/atlas  
rm -rf /home/accumulo  
rm -rf /home/hbase  
rm -rf /home/hive  
rm -rf /home/oozie  
rm -rf /home/storm  
rm -rf /home/yarn  
rm -rf /home/ambari-qa  
rm -rf /home/falcon  
rm -rf /home/hcat  
rm -rf /home/kafka  
rm -rf /home/mahout  
rm -rf /home/spark  
rm -rf /home/tez  
rm -rf /home/zookeeper  
rm -rf /home/flume  
rm -rf /home/hdfs  
rm -rf /home/knox  
rm -rf /home/mapred  
rm -rf /home/sqoop  

rm -rf /var/lib/ambari*  
rm -rf /usr/lib/python2.6/site-packages/ambari_*  
rm -rf /usr/lib/python2.6/site-packages/resource_management  
rm -rf /usr/lib/ambri-*
rm -rf /usr/hdp
rm -rf /usr/hadoop
rm -rf /usr/bin/hadoop 

rm -rf /hadoop

rm -rf /etc/ambari-metrics-collector
rm -rf /etc/ambari-metrics-monitor
rm -rf /etc/hadoop
rm -rf /etc/hbase
rm -rf /etc/hive
rm -rf /etc/sqoop
rm -rf /etc/zookeeper
rm -rf /etc/hive-hcatalog
rm -rf /etc/tez
rm -rf /etc/pig
rm -rf /etc/phoenix
rm -rf /etc/flume
rm -rf /etc/storm
rm -rf /etc/falcon
rm -rf /etc/knox
rm -rf /etc/hive-webhcat
rm -rf /etc/kafka
rm -rf /etc/slider
rm -rf /etc/storm-slider-client
rm -rf /etc/spark
rm -rf /var/run/spark
rm -rf /var/run/hadoop
rm -rf /var/run/hbase
rm -rf /var/run/hive
rm -rf /var/run/hive-hcatalog
rm -rf /var/run/zookeeper
rm -rf /var/run/flume
rm -rf /var/run/storm
rm -rf /var/run/sqoop
rm -rf /var/run/webhcat
rm -rf /var/run/hadoop-yarn
rm -rf /var/run/hadoop-mapreduce
rm -rf /var/run/kafka
rm -rf /var/run/ambari-metrics-collector
rm -rf /var/run/ambari-metrics-monitor
rm -rf /var/log/ambari-metrics-collector
rm -rf /var/log/ambari-metrics-monitor
rm -rf /var/log/hadoop
rm -rf /var/log/hbase
rm -rf /var/log/flume
rm -rf /var/log/storm
rm -rf /var/log/hadoop-yarn
rm -rf /var/log/hadoop-mapreduce
rm -rf /var/log/kafka
rm -rf /var/log/knox
rm -rf /var/log/sqoop
rm -rf /var/log/hive-hcatalog
rm -rf /var/lib/hadoop-yarn
rm -rf /var/lib/hadoop-mapreduce
rm -rf /usr/lib/flume
rm -rf /usr/lib/storm
rm -rf /var/lib/hive
rm -rf /var/lib/oozie
rm -rf /var/lib/flume
rm -rf /var/lib/hadoop-hdfs
rm -rf /var/lib/knox
rm -rf /var/lib/hadoop-mapreduce
rm -rf /var/lib/slider
rm -rf /var/log/hive
rm -rf /var/log/oozie
rm -rf /var/log/zookeeper
rm -rf /var/log/falcon
rm -rf /var/log/webhcat
rm -rf /var/log/spark
rm -rf /var/tmp/oozie
rm -rf /var/tmp/sqoo
rm -rf /var/hadoop

rm -rf /tmp/ambari-qa
rm -rf /tmp/hadoop
rm -rf /tmp/hadoop-hdfs
rm -rf /tmp/hive
rm -rf /tmp/hcat

rm -rf /opt/hadoop
rm -rf /opt/hadoop2

rm -rf /run/hadoop
rm -rf /kafka-logs



方式二:

因为没有基于页面管理的集群卸载,Ambari 通过 Ambari Shell 单独提供了一些集群配置的功能,其中就包括了集群的卸载——cluster delete。

注:作者在采用此种方式卸载集群时,仍然存在目录没有删除的情况(具体如何实现,作者没有细究,感兴趣的可以直接翻ambari-shell的源码。简单来说,就是删的不够彻底)。因此同方法一,强烈建议:请一定确保主机注册步骤无任何warning提示再进入下一步。


只要运行ambari-shell 的jar,并执行相应shell命令即可。具体操作请详见官方文档:

https://cwiki.apache.org/confluence/display/AMBARI/Ambari+Shell



你可能感兴趣的:(hadoop)