Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

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
Highlighted

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

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

Don't have an account?
Coming from Hortonworks? Activate your account here