Support Questions

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

How can I delete the host from ambari server?

avatar
Explorer

On the host I have, hiveserver2 HST Agent / SmartSense, and

Metrics Monitor / Ambari Metrics installed.

Also it shows below clients installed -

Clients / HCat Client , HDFS Client ,Hive Client , Infra Solr Client, MapReduce2 Client ,Oozie Client , Pig Client ,Slider Client , Spark2 Client, Spark Client , Sqoop Client , Tez Client , YARN Client , ZooKeeper Client

I want to remove the hiveserver2 and delete the host as I don't required it.

How can I delete the host? Please help

Do I need to stop the services and delete the host?

Thanks.

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Madhura Mhatre


You will basically need to follow the below steps:

1. GET the list of host components mapped to that particular host while you want to remove. As you must have to stop those host components (not the whole service) before deletion.
2. DELETE all host components mapped to this host
3. DELETE the host

It can be done via Ambari UI as well as using API calls.
Uisng Ambari UI : You can delete the host from Ambari UI as well. https://docs.hortonworks.com/HDPDocuments/Ambari-2.7.1.0/managing-and-monitoring-ambari/content/amb_...

Ambari UI --> Hosts (Tab) --> Click on your hostname --> On the hsot specific page you will see  "Host Actions" > "Delete Host".


Using Ambari API calls: You can refer to the "Removing a Host" section of the doc to find out the API calls:
https://cwiki.apache.org/confluence/display/AMBARI/Using+APIs+to+delete+a+service+or+all+host+compon...

View solution in original post

6 REPLIES 6

avatar
Master Mentor

@Madhura Mhatre


You will basically need to follow the below steps:

1. GET the list of host components mapped to that particular host while you want to remove. As you must have to stop those host components (not the whole service) before deletion.
2. DELETE all host components mapped to this host
3. DELETE the host

It can be done via Ambari UI as well as using API calls.
Uisng Ambari UI : You can delete the host from Ambari UI as well. https://docs.hortonworks.com/HDPDocuments/Ambari-2.7.1.0/managing-and-monitoring-ambari/content/amb_...

Ambari UI --> Hosts (Tab) --> Click on your hostname --> On the hsot specific page you will see  "Host Actions" > "Delete Host".


Using Ambari API calls: You can refer to the "Removing a Host" section of the doc to find out the API calls:
https://cwiki.apache.org/confluence/display/AMBARI/Using+APIs+to+delete+a+service+or+all+host+compon...

avatar
Explorer

Thank you @Jay Kumar SenSharma . I have one follow up question-

1. How do get all components for that host? Is it from ambari Ambari UI -->Hosts(Tab)-->Click on your hostname and it will show all the components right? I also see some clients installed but no stop button for clients...

2. How do I remove those? or there is no need to remove those clients?

3. Do I need to delete the components or just stopping would work?

4. Do you think I will have to restart any services / ambari server after deleting the host?

Looking forward for your reply.

avatar
Master Mentor

@Madhura Mhatre

1. How do get all components for that host? Is it from ambari Ambari UI -->Hosts(Tab)-->Click on your hostname and it will show all the components right? I also see some clients installed but no stop button for clients...

>>>> Yes, you can get the list of components installed ona host using the Ambari UI -->Hosts(Tab)-->Click on your hostname

>>>> Clients need not be started/stopped. So there is no Button to stop/start clients.

2. How do I remove those? or there is no need to remove those clients?

>>>> Just stop the components which are running. Then you should be able to delete the host. However if you ahve any Master component installed to the host like Ambari Metrics Collector then better to delete it from that host and add it to another host of that cluster.

NOTE: Ambari can show messages as following when you try to delete a Host:

------> "Deletion of the following x components is not supported." and will list the components names which needs service deletion.

3. Do I need to delete the components or just stopping would work?

>>>> If you want to Delete a Host from your cluster then it should not be having any running components. Please stop them first.

4. Do you think I will have to restart any services / ambari server after deleting the host?

>>>> Depends, which kind of config changes might happen due to the host deletion where the components are installed. Ambari can show messages as following when you try to delete a Host: "Deletion of the following x components is not supported."

like for example you will see "Delete" button is disabled on your Ambari UI hosts page for HiveServer2 , until you add another HiveServer2 on any other cluster node. Then only you will see that the HiveServer2 "delete" button becoms active.

So for some master components needs to be either installed to some other node of the cluster Or the Whole service need to be deleted.


avatar
Explorer

@Jay Kumar SenSharma Thank you so much for your prompt response.

I have below components in this host

  • hiveserver2
  • HST Agent / SmartSense,
  • Metrics Monitor / Ambari Metrics

Ambari metrics collector is installed on different host. I believe "Metrics Monitor/Ambari Metrics" is not master component right?

Thank you Jay. All the information you provided is really helpful.

avatar
Master Mentor

@Madhura Mhatre

Correct, Metrics Monitor and HST Agent are not master component. So you can just Stop them and then Delete the host.

avatar
Rising Star

Hi @Jay Kumar SenSharma @Madhura Mhatre

else You can delete requested services directly from CLI by using API call.


It will list components of services

curl -u admin -H "X-Requested-By:ambari" -X GET http://<ambari-server_host>/api/v1/clusters/<clustername>/hosts/<fqdn_of_requested_node_to_delete_se...;


EX:
curl -u admin -H "X-Requested-By:ambari" -X GET http://<ambari-server_host>/api/v1/clusters/<clustername>/hosts/fdlslr7v211.pwcccorp.net


To Delete  service:
curl -u admin -H "X-Requested-By:ambari" -X DELETE http://<ambari-server_host>/api/v1/clusters/<clustername>/hosts/<fqdn_of_requested_node_to_delete_se...;

Example to delete HST_AGENT:
curl -u admin -H "X-Requested-By:ambari" -X GET http://<ambari-server_host>/api/v1/clusters/<clustername>/hosts/fdlslr7v211.pwcccorp.net/HST_AGENT