-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/33885/
-----------------------------------------------------------
Review request for Ambari and Andrew Onischuk.
Bugs: AMBARI-10953
https://issues.apache.org/jira/browse/AMBARI-10953
Repository: ambari
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.
Diffs
-----
ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py
f0036be
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py
35217fc
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
0d5d580
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
38bdced
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/service_check.py
03af5b6
ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py c08332a
ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_service_check.py
e43917d
Diff: https://reviews.apache.org/r/33885/diff/
Testing
-------
----------------------------------------------------------------------
Ran 263 tests in 6.238s
OK
----------------------------------------------------------------------
Total run:723
Total errors:0
Total failures:0
OK
Process finished with exit code 0
Thanks,
Dmitro Lisnichenko