Community Articles

Find and share helpful community-sourced technical articles.
Cloudera Employee

NOTE: This is for information and testing purposes only. Pleaes exercise caution prior to using it on business critical environments.


To completely remove HDP stack from the Operating System, do the following:

1. Stop all the services in Ambari UI.

2. Shutdown ambari-server and ambari-agent on Ambari server host using the following commands:

$ ambari-server stop
$ ambari-agent stop

3. Shutdown ambari-agent on all other nodes using the following commands:

$ ambari-agent stop

4. Run the following command to check the installed services to delete the related configs and directories:

$ hdp-select | grep -v 'None'

5. Follow this URLto uninstall each services that is installed as per the above step or from the Ambari UI.

6. Remove all the files and directory related with Hadoop and HDP using the following commands. This step will delete all the files and directories name with hadoop under root partition. Please be extra caution to run this step and make sure you have nothing important in these directories.

find / -name hadoop -type d | xargs rm -rf; rm -rf /usr/hdp
find / -name hadoop-* -type d | xargs rm -rf

7. Based on the services that are installed, delete old users like HDFS, YARN, MAPRED etc, using the following commands:

$ userdel -r hdfs
$ userdel -r yarn
$ userdel -r mapred

8. Similarly delete other users like hive, hbase, oozie, etc if these services are installed on the cluster.

9. If you want to reset the Ambari Database to remove the deleted cluster information then do the following:

  1. Take a backup of Ambari database to your backup location using the steps mentioned in this document.
  2. Reset the Ambari database using the following command from Ambari Server host:
$ ambari-server reset
Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.
Version history
Last update:
‎09-16-2022 01:39 AM
Updated by:
Top Kudoed Authors