Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to Completely Clean, Remove or Uninstall Ambari for Fresh Install

avatar

Sometimes when installing Ambari run repos are downloaded or there are maybe issues with python.

1 ACCEPTED SOLUTION

avatar
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
9 REPLIES 9

avatar
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

avatar
Master Mentor

@amcbarnett@hortonworks.com

https://gist.github.com/nsabharwal/f57bb9e607114833df9b

Important

Ambari reinstall will give you following command while running check during the cluster install. It will save you lot of time

I run with --skip=users

python /usr/lib/python2.6/site-packages/ambari_agent/HostCleanup.py --silent --skip=users

avatar

avatar
Expert Contributor

There you go! Here's the solution to your problem. I struggled with this for like weeks and tried uninstalling and reinstalling over and over and then finally decided to share it here : How to completely remove and uninstall HDP

avatar
New Contributor

Hi, the link seems broken. Can you share with us the working one? Thanks.

avatar
Explorer

I noticed couple of typos. be mindful if you are running them in batch

rm -rf /usr/lib/amrbari-server

rm-rf /usr/lib/python2.6/site-packages/ambari*

avatar
Rising Star
@Ancil McBarnett

will your above solution delete the existing HDP installation also ?

avatar

No it doesn't. You have to run additional scripts to delete HDP

avatar
Expert Contributor

One of Powerful clean up by below python script on hadoop , It clean all directory , including user and files

[root@.ssh]# python /usr/lib/python2.6/site-packages/ambari_agent/HostCleanup.py --silent
INFO:HostCleanup:
Killing pid's: ['']

INFO:HostCleanup:Deleting packages: ['']

INFO:HostCleanup:
Deleting users: ['ams', 'ambari-qa', 'yarn', 'mapred', 'tez', 'hbase', 'sqoop', 'oozie', 'falcon', 'flume', 'hive', 'hcat']
INFO:HostCleanup:Executing command: /var/lib/ambari-agent/ambari-sudo.sh userdel -rf ams
INFO:HostCleanup:Successfully deleted user: ams
INFO:HostCleanup:Executing command: /var/lib/ambari-agent/ambari-sudo.sh userdel -rf ambari-qa
INFO:HostCleanup:Successfully deleted user: ambari-qa
INFO:HostCleanup:Executing command: /var/lib/ambari-agent/ambari-sudo.sh userdel -rf yarn
INFO:HostCleanup:Successfully deleted user: yarn
INFO:HostCleanup:Executing command: /var/lib/ambari-agent/ambari-sudo.sh userdel -rf mapred
INFO:HostCleanup:Successfully deleted user: mapred
INFO:HostCleanup:Executing command: /var/lib/ambari-agent/ambari-sudo.sh userdel -rf tez
INFO:HostCleanup:Successfully deleted user: tez
INFO:HostCleanup:Executing command: /var/lib/ambari-agent/ambari-sudo.sh userdel -rf hbase
INFO:HostCleanup:Successfully deleted user: hbase
INFO:HostCleanup:Executing command: /var/lib/ambari-agent/ambari-sudo.sh userdel -rf sqoop
INFO:HostCleanup:Successfully deleted user: sqoop
INFO:HostCleanup:Executing command: /var/lib/ambari-agent/ambari-sudo.sh userdel -rf oozie
INFO:HostCleanup:Successfully deleted user: oozie
INFO:HostCleanup:Executing command: /var/lib/ambari-agent/ambari-sudo.sh userdel -rf falcon
INFO:HostCleanup:Successfully deleted user: falcon
INFO:HostCleanup:Executing command: /var/lib/ambari-agent/ambari-sudo.sh userdel -rf flume
INFO:HostCleanup:Successfully deleted user: flume
INFO:HostCleanup:Executing command: /var/lib/ambari-agent/ambari-sudo.sh userdel -rf hive
INFO:HostCleanup:Successfully deleted user: hive
INFO:HostCleanup:Executing command: /var/lib/ambari-agent/ambari-sudo.sh userdel -rf hcat
INFO:HostCleanup:Successfully deleted user: hcat
INFO:HostCleanup:Executing command: /var/lib/ambari-agent/ambari-sudo.sh groupdel hadoop
WARNING:HostCleanup:Cannot delete group : hadoop, groupdel: cannot remove the primary group of user 'hduser'
INFO:HostCleanup:Path doesn't exists: /home/ams
INFO:HostCleanup:Path doesn't exists: /home/ambari-qa
INFO:HostCleanup:Path doesn't exists: /home/yarn
INFO:HostCleanup:Path doesn't exists: /home/mapred
INFO:HostCleanup:Path doesn't exists: /home/tez
INFO:HostCleanup:Path doesn't exists: /home/hbase
INFO:HostCleanup:Path doesn't exists: /home/sqoop
INFO:HostCleanup:Path doesn't exists: /home/oozie
INFO:HostCleanup:Path doesn't exists: /home/falcon
INFO:HostCleanup:Path doesn't exists: /home/flume
INFO:HostCleanup:Path doesn't exists: /home/hive
INFO:HostCleanup:Path doesn't exists: /home/hcat
INFO:HostCleanup:Deleting file/folder: /tmp/Jetty_0_0_0_0_60010_master____q3nwom
INFO:HostCleanup:Deleting file/folder: /tmp/Jetty_0_0_0_0_34300_mapreduce____.dx7bll
INFO:HostCleanup:Deleting file/folder: /tmp/hbase-hbase
INFO:HostCleanup:Deleting file/folder: /tmp/Jetty_0_0_0_0_34025_mapreduce____jgsznr
INFO:HostCleanup:Deleting file/folder: /tmp/Jetty_centos4_test_com_8088_cluster____.cl0kmf
INFO:HostCleanup:Deleting file/folder: /tmp/Jetty_0_0_0_0_8042_node____19tj0x
INFO:HostCleanup:
Deleting directories: ['']
INFO:HostCleanup:Path doesn't exists:
INFO:HostCleanup:
Deleting repo files: []
INFO:HostCleanup:
Erasing alternatives:{'symlink_list': [''], 'target_list': ['']}

INFO:HostCleanup:Path doesn't exists:
INFO:HostCleanup:Clean-up completed. The output is at /var/lib/ambari-agent/data/hostcleanup.result