In the Namenode and Yarn HA scenario One is in Active and the other in standby whereas in the case of HiveServer2 both are Active and if you are connecting to HiveServer2 through zookeeper it will pick the one which is available based on the traffic.