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.
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: