Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
Description
ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py uses a combination of beeline and sockets to check the availability of the Hive server.
Hive Server can be configured to run in either binary or http mode, as configured by the following property in hive-site:
<property> <name>hive.server2.transport.mode</name> <value>binary</value> </property>
The python, however, only runs the beeline command if KERBEROS is in use AND the mode is binary. This not correct in that beeline can connect via both TCP and HTTP:
beeline -u 'jdbc:hive2://c6402.ambari.apache.org:10000/;transportMode=binary' -e '' beeline -u 'jdbc:hive2://c6402.ambari.apache.org:10001/;transportMode=http' -e ''
Additionally, alert_hive_thrift_port.py needs to provide a better error message. Currently, the code
try: hive_check.check_thrift_port_sasl(host_name, port, hive_server2_authentication, hive_server_principal, kinitcmd, smokeuser, transport_mode = transport_mode) is_thrift_port_ok = True except: is_thrift_port_ok = False if is_thrift_port_ok == True: result_code = 'OK' total_time = time.time() - start_time label = OK_MESSAGE % (total_time, port) else: result_code = 'CRITICAL' label = CRITICAL_MESSAGE.format(host_name,port)
will not show the exact error message and instead just say that it couldn't connect to host:port, which is wrong since that implies the only failure could be TCP-based. I recommend putting the exception message in as well.
Attachments
Issue Links
- links to