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

How to identify if Hiveserver2 is active or not in CDH?

Expert Contributor

Is there a way to determine the Hiverserver2 status without instantiating beeline? I have two Hiveserver2 hosts and both of them will be active always but just to make my code more effective I want to check both the hosts. My code will check the hosts one by one and connect to the one which shows active first. So is there a way where we can determine the hosts status? I tried ifconfig(i know i am silly :)) but don't know any other way to get the answer.

2 REPLIES 2

Expert Contributor

I would suggest using the Ambari API service checks. There is an example on the Ambari github:

https://github.com/apache/ambari/blob/trunk/ambari-server/docs/api/v1/service-resources.md

And some more information on the Ambari wiki:

https://cwiki.apache.org/confluence/display/AMBARI/Running+Service+Checks

Expert Contributor

@bhagan, I am using CDH and sorry I did not mention that in my question.