This article is for redhat or centos
For the test cluster, if you want to restart the Hadoop cluster after installing it through ambari, you need to clean the cluster.
For many hadoop components installed, this work is very tedious. Next is the cleanup process I put together.
1. Close all components in the cluster through ambari. If it cannot be closed, kill -9 XXX directly
2. Close ambari-server, ambari-agent
- ambari-server stop
- ambari-agent stop
3. Uninstall the installed software
- yum remove hadoop_2* hdp-select* ranger_2* zookeeper_* bigtop* atlas-metadata* ambari* postgresql spark* slider* storm* snappy*
The above command may not be complete. After executing the command, execute it again.
- yum list | grep @HDP
Check if there is any uninstalled, if so, continue to uninstall via #yum remove XXX
4, delete postgresql data
After the postgresql software is uninstalled, its data still remains in the hard disk, and this part of the data needs to be deleted. If it is not deleted, after reinstalling the ambari-server, the previous installation data may still be applied, and these data are incorrect data, so needs to be deleted.
- rm -rf /var/lib/pgsql
5. Delete the user
When ambari installs a hadoop cluster, some users will be created. When clearing the cluster, it is necessary to clear these users and delete the corresponding folders. Doing so avoids problems with file access permissions errors when the cluster is running.
- 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
6. Delete ambari legacy data
- 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-*
7. Delete the legacy data of other hadoop components
-
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/zookeeper
rm -rf /var/run/flume
rm -rf /var/run/storm
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/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/knox
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/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 /tmp/ambari-qa
rm -rf /var/hadoop
rm -rf /hadoop/falcon
rm -rf /tmp/hadoop
rm -rf /tmp/hadoop-hdfs
rm -rf /usr/hdp
rm -rf /usr/hadoop
rm -rf /opt/hadoop
rm -rf /opt/hadoop2
rm -rf /tmp/hadoop
rm -rf /var/hadoop
rm -rf /hadoop
rm -rf /etc/ambari-metrics-collector
rm -rf /etc/ambari-metrics-monitor
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/lib/hadoop-yarn
rm -rf /var/lib/hadoop-mapreduce
8. Clean up the yum data source