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.


Expert Contributor

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

And some more information on the Ambari wiki:

Expert Contributor

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