ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From swa...@apache.org
Subject ambari git commit: AMBARI-17263. Fix for following for Hive Server Interactive : (1). Updates to 'llapstatus' command while querying LLAP app status. (2). Adding validation check for config 'hive.server2.enable.doAs'.
Date Wed, 15 Jun 2016 19:28:25 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 fcb83e71a -> 0501d903e


AMBARI-17263. Fix for following for Hive Server Interactive : (1). Updates to 'llapstatus'
command while querying LLAP app status. (2). Adding validation check for config 'hive.server2.enable.doAs'.


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0501d903
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0501d903
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0501d903

Branch: refs/heads/branch-2.4
Commit: 0501d903e317c75ae8e4ec610f48d8bd4b12bf2a
Parents: fcb83e7
Author: Swapan Shridhar <sshridhar@hortonworks.com>
Authored: Wed Jun 15 12:28:09 2016 -0700
Committer: Swapan Shridhar <sshridhar@hortonworks.com>
Committed: Wed Jun 15 12:28:09 2016 -0700

----------------------------------------------------------------------
 .../HIVE/0.12.0.2.0/package/alerts/alert_llap_app_status.py | 4 +++-
 .../0.12.0.2.0/package/scripts/hive_server_interactive.py   | 9 +++++----
 .../main/resources/stacks/HDP/2.5/services/stack_advisor.py | 8 ++++++++
 .../stacks/2.5/common/services-normal-his-2-hosts.json      | 3 ++-
 .../src/test/python/stacks/2.5/common/test_stack_advisor.py | 6 ++++--
 5 files changed, 22 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0501d903/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_llap_app_status.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_llap_app_status.py
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_llap_app_status.py
index 12c5c19..d65322d 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_llap_app_status.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_llap_app_status.py
@@ -101,6 +101,8 @@ def execute(configurations={}, parameters={}, host_name=None):
   host_name (string): the name of this host where the alert is running
   """
 
+  LLAP_APP_STATUS_CMD_TIMEOUT = 0
+
   if configurations is None:
     return ('UNKNOWN', ['There were no configurations supplied to the script.'])
 
@@ -155,7 +157,7 @@ def execute(configurations={}, parameters={}, host_name=None):
 
     start_time = time.time()
     if STACK_ROOT in configurations:
-      llap_status_cmd = configurations[STACK_ROOT] + format("/current/hive-server2-hive2/bin/hive
--service llapstatus --name {llap_app_name}")
+      llap_status_cmd = configurations[STACK_ROOT] + format("/current/hive-server2-hive2/bin/hive
--service llapstatus --name {llap_app_name}  -findAppTimeout {LLAP_APP_STATUS_CMD_TIMEOUT}")
     else:
       llap_status_cmd = format("/usr/hdp/current/hive-server2-hive2/bin/hive --service llapstatus
--name {llap_app_name}")
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/0501d903/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
index 7de3d49..c055cf1 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
@@ -290,8 +290,9 @@ class HiveServerInteractiveDefault(HiveServerInteractive):
     """
     def _get_llap_app_status_info(self, app_name):
       import status_params
+      LLAP_APP_STATUS_CMD_TIMEOUT = 0
 
-      llap_status_cmd = format("{stack_root}/current/hive-server2-hive2/bin/hive --service
llapstatus --name {app_name}")
+      llap_status_cmd = format("{stack_root}/current/hive-server2-hive2/bin/hive --service
llapstatus --name {app_name} -findAppTimeout {LLAP_APP_STATUS_CMD_TIMEOUT}")
       code, output, error = shell.checked_call(llap_status_cmd, user=status_params.hive_user,
stderr=subprocess.PIPE,
                                                logoutput=False)
       llap_app_info = json.loads(output)
@@ -318,7 +319,7 @@ class HiveServerInteractiveDefault(HiveServerInteractive):
         num_retries = 2
       if num_retries > 20:
         num_retries = 20
-      @retry(times=num_retries, sleep_time=15, err_class=Fail)
+      @retry(times=num_retries, sleep_time=2, err_class=Fail)
       def do_retries():
         live_instances = 0
         desired_instances = 0
@@ -366,11 +367,11 @@ class HiveServerInteractiveDefault(HiveServerInteractive):
                                                        time.time() - curr_time))
             raise Fail("App state is RUNNING_PARTIAL. Live Instances : '{0}', Desired Instance
: '{1}'".format(llap_app_info['liveInstances'],
                                                                                         
                  llap_app_info['desiredInstances']))
-        elif llap_app_info['state'].upper() in ['APP_NOT_FOUND', 'LAUNCHING']:
+        elif llap_app_info['state'].upper() in ['APP_NOT_FOUND', 'LAUNCHING', 'COMPLETE']:
           status_str = format("LLAP app '{0}' current state is {1}.".format(llap_app_name,
llap_app_info['state']))
           Logger.info(status_str)
           raise Fail(status_str)
-        else:  # Covers state "COMPLETE" and any unknown that we get.
+        else:  # Covers any unknown that we get.
           Logger.info(
             "LLAP app '{0}' current state is '{1}'. Expected : 'RUNNING'.".format(llap_app_name,
llap_app_info['state']))
           return False

http://git-wip-us.apache.org/repos/asf/ambari/blob/0501d903/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
index 81f1be6..b896a6a 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/stack_advisor.py
@@ -127,6 +127,7 @@ class HDP25StackAdvisor(HDP24StackAdvisor):
       1. Queue selected in 'hive.llap.daemon.queue.name' config should be sized >= to
minimum required to run LLAP
          and Hive2 app.
       2. Queue selected in 'hive.llap.daemon.queue.name' config state should not be 'STOPPED'.
+      3. 'hive.server2.enable.doAs' config should be set to 'false' for Hive2.
   """
   def validateHiveInteractiveSiteConfigurations(self, properties, recommendedDefaults, configurations,
services, hosts):
     validationItems = []
@@ -174,6 +175,13 @@ class HDP25StackAdvisor(HDP24StackAdvisor):
         Logger.error("Couldn't retrieve 'capacity-scheduler' properties while doing validation
checks for Hive Server Interactive.")
         pass
 
+      # Validate that 'hive.server2.enable.doAs' config is not set to 'true' for Hive2.
+      if self.HIVE_INTERACTIVE_SITE in services['configurations']:
+        if 'hive.server2.enable.doAs' in services['configurations'][self.HIVE_INTERACTIVE_SITE]['properties']:
+          hive2_enable_do_as = services['configurations'][self.HIVE_INTERACTIVE_SITE]['properties']['hive.server2.enable.doAs']
+          if hive2_enable_do_as == 'true':
+            validationItems.append({"config-name": "hive.server2.enable.doAs","item": self.getErrorItem("Value
should be set to 'false' for Hive2.")})
+
     validationProblems = self.toConfigurationValidationProblems(validationItems, "hive-interactive-site")
     return validationProblems
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/0501d903/ambari-server/src/test/python/stacks/2.5/common/services-normal-his-2-hosts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.5/common/services-normal-his-2-hosts.json
b/ambari-server/src/test/python/stacks/2.5/common/services-normal-his-2-hosts.json
index 4b47cf8..b78619b 100644
--- a/ambari-server/src/test/python/stacks/2.5/common/services-normal-his-2-hosts.json
+++ b/ambari-server/src/test/python/stacks/2.5/common/services-normal-his-2-hosts.json
@@ -1049,7 +1049,8 @@
   "configurations" : {
     "hive-interactive-site" : {
       "properties": {
-        "hive.llap.daemon.queue.name": "llap"
+        "hive.llap.daemon.queue.name": "llap",
+        "hive.server2.enable.doAs": "true"
       }
     },
     "capacity-scheduler" : {

http://git-wip-us.apache.org/repos/asf/ambari/blob/0501d903/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
index 4085ad6..7d5a03f 100644
--- a/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
+++ b/ambari-server/src/test/python/stacks/2.5/common/test_stack_advisor.py
@@ -512,7 +512,7 @@ class TestHDP25StackAdvisor(TestCase):
 
 
   """
-  Tests validation errors for Hive Server Interactive site.
+  Tests validations for Hive Server Interactive site.
   """
   def test_validateHiveInteractiveSiteConfigurations(self):
     # Performing setup
@@ -555,12 +555,14 @@ class TestHDP25StackAdvisor(TestCase):
     # and selected queue current state is "STOPPED".
     # Expected : 1. Error telling about the current size compared to minimum required size.
     #            2. Error telling about current state can't be STOPPED. Expected : RUNNING.
+    #            3. Error telling about config 'hive.server2.enable.doAs' to be false at
all times.
     services2 = self.load_json("services-normal-his-2-hosts.json")
     res_expected2 = [
       {'config-type': 'hive-interactive-site', 'message': "Selected queue 'llap' capacity
(49%) is less than minimum required "
                                                           "capacity (50%) for LLAP app to
run", 'type': 'configuration', 'config-name': 'hive.llap.daemon.queue.name', 'level': 'ERROR'},
       {'config-type': 'hive-interactive-site', 'message': "Selected queue 'llap' current
state is : 'STOPPED'. It is required to be in "
-                                                          "'RUNNING' state for LLAP to run",
'type': 'configuration', 'config-name': 'hive.llap.daemon.queue.name', 'level': 'ERROR'}
+                                                          "'RUNNING' state for LLAP to run",
'type': 'configuration', 'config-name': 'hive.llap.daemon.queue.name', 'level': 'ERROR'},
+      {'config-type': 'hive-interactive-site', 'message': "Value should be set to 'false'
for Hive2.", 'type': 'configuration', 'config-name': 'hive.server2.enable.doAs', 'level':
'ERROR'}
     ]
     res2 = self.stackAdvisor.validateHiveInteractiveSiteConfigurations({}, {}, {}, services2,
hosts)
     self.assertEquals(res2, res_expected2)


Mime
View raw message