Rest service to get the name node Host ID from thousand of node from cloudera hadoop cluster
1) get the cluster name
clustername = HttpClient(http://:7180/api/v10/clusters)
2) now get the HostID
host_id=HttpClient(http://:7180/api/v10/clusters/${clustername}/services/hdfs/roles)
3) Now get the Hostname which is on with Namenode
host_name=HttpClient(http://:7180/api/v10/hosts/fb50e775-33b7-4f38-b268-2bb3220695e1)
Now you have the host name which is on with name node .
NOTE : Here I just used HttpClient as a sample method which will get the details from rest service and parse as per the requirements.
-Khirod
1) get the cluster name
clustername = HttpClient(http://
2) now get the HostID
host_id=HttpClient(http://
3) Now get the Hostname which is on with Namenode
host_name=HttpClient(http://
Now you have the host name which is on with name node .
NOTE : Here I just used HttpClient as a sample method which will get the details from rest service and parse as per the requirements.
-Khirod
No comments:
Post a Comment