Support Questions

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

how to remove a host which include journal node component using ambari

avatar
Contributor

a host crashed which include journal node,but now ambari can not remove host which include jurnal node, anyone has i

1 ACCEPTED SOLUTION

avatar
Master Guru

@Dim Guy please take a look at documentation here.

Removing a Host (2.1.0)

Verified against releases 2.1.0

The preferred way to remove a host is to move the master services from the host, decommission the slave nodes and then remove the host afterdeleting all the host components. However, there are situations such as the host is lost and cannot be brought back online for graceful removal. Under this circumstances the following API calls can be used to clean up the host.

1. Get a list of host components mapped to the host

curl -u admin:admin -H "X-Requested-By: ambari" -X GET http://AMBARI_SERVER_HOST:8080/api/v1/clusters/c1/hosts/HOSTNAME

See the property, "host_components" for all the host.

Sample:

Output: ... "host_components" : [ { "href" : "http://AMBARI_SERVER_HOST:8080/api/v1/clusters/CLUSTERNAME/hosts/HOSTNAME/host_components/DATANODE", "HostRoles" : { "cluster_name" : "CLUSTERNAME", "component_name" : "DATANODE", "host_name" : "HOSTNAME" } }, { "href" : "http://AMBARI_SERVER_HOST:8080/api/v1/clusters/CLUSTERNAME/hosts/HOSTNAME/host_components/GANGLIA_MO..., "HostRoles" : { "cluster_name" : "CLUSTERNAME", "component_name" : "GANGLIA_MONITOR", "host_name" : "HOSTNAME" } }] ...

2. DELETE all host components mapped to this host

E.g. Delete 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

3. 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

View solution in original post

3 REPLIES 3

avatar
Master Guru

@Dim Guy please take a look at documentation here.

Removing a Host (2.1.0)

Verified against releases 2.1.0

The preferred way to remove a host is to move the master services from the host, decommission the slave nodes and then remove the host afterdeleting all the host components. However, there are situations such as the host is lost and cannot be brought back online for graceful removal. Under this circumstances the following API calls can be used to clean up the host.

1. Get a list of host components mapped to the host

curl -u admin:admin -H "X-Requested-By: ambari" -X GET http://AMBARI_SERVER_HOST:8080/api/v1/clusters/c1/hosts/HOSTNAME

See the property, "host_components" for all the host.

Sample:

Output: ... "host_components" : [ { "href" : "http://AMBARI_SERVER_HOST:8080/api/v1/clusters/CLUSTERNAME/hosts/HOSTNAME/host_components/DATANODE", "HostRoles" : { "cluster_name" : "CLUSTERNAME", "component_name" : "DATANODE", "host_name" : "HOSTNAME" } }, { "href" : "http://AMBARI_SERVER_HOST:8080/api/v1/clusters/CLUSTERNAME/hosts/HOSTNAME/host_components/GANGLIA_MO..., "HostRoles" : { "cluster_name" : "CLUSTERNAME", "component_name" : "GANGLIA_MONITOR", "host_name" : "HOSTNAME" } }] ...

2. DELETE all host components mapped to this host

E.g. Delete 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

3. 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

avatar

@Dim Guy / @Sunile Manjee

It might be required to stop the component as well before Deleting the host components in the host:

curl -u admin:admin -X PUT -d '{"RequestInfo":{"context":"Stop Service"},"Body":{"ServiceInfo":{"state":"INSTALLED"}}}'http://AMBARI_SERVER_HOST:8080/api/v1/clusters/c1/services/SERVICE_NAME

avatar
Master Guru

@vpoornalingam I believe your right. Might actually be safer to stop first.