Support Questions
Find answers, ask questions, and share your expertise

How to get the HiveServer2 host/ip address using CDH api call?

Expert Contributor

I am trying to get the HiveServer2 ip address using CDH API call. I have tried the below command but it is not working. It doesnot throw any error too.

curl -u admin:admin 'http://localhost:7180/api/v1/clusters/nameservice1/services/HIVE/components/HIVE_SERVER'

 I have reffered to the API tutorial page as well but did not get much out of it (may be I missed something). Could someone help me with this regard?

1 REPLY 1

New Contributor

1. call http://localhost:7180/api/v11/clusters/CLUSTERNAME/services/hive/roles
will give you where services are located (filter by "type" : "HIVESERVER2", look for "hostRef" : {
"hostId" : "i-xxxxxx")

 

2. call http://localhost:7180/api/v11/hosts

will give you hostid to ip mapping

 

take a look: http://www.cloudera.com/documentation/enterprise/5-5-x/topics/cm_intro_api.html