Support Questions

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

how to delete worker node from cluster

avatar

our 3 master machines was crashed , and we build new 3 masters machines ( without to delete the workers )

so now we need to re-add the current workers to the cluster

when we add the workers machine to the ambari cluster we stuck in point that wizard tell us the worker already installed

how to solve this issuie from this point ?

Michael-Bronson
1 ACCEPTED SOLUTION

avatar
Master Mentor

@uri ben-ari

curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://{your_ambari_server}:8080/api/v1/clusters/{your_cluster_name}/hosts/{dead_host}

Example

curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://test.co.uk:8080/api/v1/clusters/hdp26/hosts/datanode2

View solution in original post

4 REPLIES 4

avatar
Master Mentor

@uri ben-ari

Check /etc/hosts of the Ambari server and make sure the old entries are removed ,realce with the new one.

DELETE all host components mapped to this host in this case DATANODE

curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://AMBARI_SERVER_HOST:8080/api/v1/clusters/CLUSTERNAME/hosts/HOSTNAME/host_components/DATANODE DELETE the host 
curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://AMBARI_SERVER_HOST:8080/api/v1/clusters/CLUSTERNAME/hosts/HOSTNAME 

And you will need to restart all stale config

avatar

regarding to two API , can you give me example , because I not sure if some of them need to set as values or should be as default

Michael-Bronson

avatar

another question , as you know all workers are not appears cluster ( because all master machines are new ) , so not understand how we can use the API in that case

Michael-Bronson

avatar
Master Mentor

@uri ben-ari

curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://{your_ambari_server}:8080/api/v1/clusters/{your_cluster_name}/hosts/{dead_host}

Example

curl -u admin:admin -H "X-Requested-By: ambari" -X DELETE http://test.co.uk:8080/api/v1/clusters/hdp26/hosts/datanode2