You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2018/08/31 20:05:57 UTC

[ambari] branch trunk updated: [AMBARI-24582] - Ambari Alert - HiveServer2 Process - False negative in Certain Scenarios

This is an automated email from the ASF dual-hosted git repository.

jonathanhurley pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new a4b2901  [AMBARI-24582] - Ambari Alert - HiveServer2 Process - False negative in Certain Scenarios
a4b2901 is described below

commit a4b2901a9a16e356c230fb647471e099b2d965ba
Author: Jonathan Hurley <jo...@apache.org>
AuthorDate: Fri Aug 31 13:52:34 2018 -0400

    [AMBARI-24582] - Ambari Alert - HiveServer2 Process - False negative in Certain Scenarios
---
 .../resource_management/libraries/functions/hive_check.py     | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py b/ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py
index d8f6696..39df3b5 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py
@@ -25,8 +25,9 @@ from resource_management.core.signal_utils import TerminateStrategy
 
 
 def check_thrift_port_sasl(address, port, hive_auth="NOSASL", key=None, kinitcmd=None, smokeuser='ambari-qa',
-                           transport_mode="binary", http_endpoint="cliservice", ssl=False, ssl_keystore=None,
-                           ssl_password=None, check_command_timeout=30, ldap_username="", ldap_password=""):
+                           hive_user='hive', transport_mode="binary", http_endpoint="cliservice",
+                           ssl=False, ssl_keystore=None, ssl_password=None, check_command_timeout=30,
+                           ldap_username="", ldap_password=""):
   """
   Hive thrift SASL port check
   """
@@ -71,8 +72,10 @@ def check_thrift_port_sasl(address, port, hive_auth="NOSASL", key=None, kinitcmd
     finally:
       kinit_lock.release()
 
-  cmd = "! beeline -u '%s' %s -e '' 2>&1| awk '{print}'|grep -i -e 'Connection refused' -e 'Invalid URL'" % \
-        (format(";".join(beeline_url)), format(credential_str))
+  # -n the user to connect as (ignored when using the hive principal in the URL, can be different from the user running the beeline command)
+  # -e ';' executes a SQL commmand of NOOP
+  cmd = "beeline -n %s -u '%s' %s -e ';' 2>&1 | awk '{print}' | grep -i -e 'Connected to:' -e 'Transaction isolation:'" % \
+        (format(hive_user), format(";".join(beeline_url)), format(credential_str))
 
   Execute(cmd,
     user=smokeuser,