You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vb...@apache.org on 2015/11/06 11:34:30 UTC

ambari git commit: AMBARI-13749. Hive server 2 fails to start in kerberized environment.(vbrodetskyi)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 d37f881e5 -> 64bd2ec1a


AMBARI-13749. Hive server 2 fails to start in kerberized environment.(vbrodetskyi)


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

Branch: refs/heads/branch-2.1
Commit: 64bd2ec1a7303ed0f526ca0921714881ec8f2eb8
Parents: d37f881
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Fri Nov 6 12:34:01 2015 +0200
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Fri Nov 6 12:34:01 2015 +0200

----------------------------------------------------------------------
 .../HIVE/0.12.0.2.0/package/scripts/hive_service.py       |  5 +++++
 .../src/test/python/stacks/2.0.6/HIVE/test_hive_server.py | 10 +++++++++-
 .../src/test/python/stacks/2.0.6/configs/secured.json     |  3 ++-
 3 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/64bd2ec1/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
index 456c018..cda869e 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_service.py
@@ -59,6 +59,11 @@ def hive_service(name, action='start', upgrade_type=None):
     pid_file = format("{hive_pid_dir}/{hive_pid}")
     cmd = format("{start_hiveserver2_path} {hive_log_dir}/hive-server2.out {hive_log_dir}/hive-server2.log {pid_file} {hive_server_conf_dir} {hive_log_dir}")
 
+    if params.security_enabled and params.current_version != None and (params.current_version.startswith("2.2.4") or
+          params.current_version.startswith("2.2.3")):
+      hive_kinit_cmd = format("{kinit_path_local} -kt {hive_server2_keytab} {hive_principal}; ")
+      Execute(hive_kinit_cmd, user=params.hive_user)
+
   pid_expression = "`" + as_user(format("cat {pid_file}"), user=params.hive_user) + "`"
   process_id_exists_command = format("ls {pid_file} >/dev/null 2>&1 && ps -p {pid_expression} >/dev/null 2>&1")
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/64bd2ec1/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
index ed20c96..8aa2b53 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HIVE/test_hive_server.py
@@ -273,6 +273,10 @@ class TestHiveServer(RMFTestCase):
     )
 
     self.assert_configure_secured()
+    self.assertResourceCalled('Execute',
+                              '/usr/bin/kinit -kt /etc/security/keytabs/hive.service.keytab hive/c6401.ambari.apache.org@EXAMPLE.COM; ',
+                              user = 'hive',
+                              )
     self.assertResourceCalled('Execute', '/tmp/start_hiveserver2_script /var/log/hive/hive-server2.out /var/log/hive/hive-server2.log /var/run/hive/hive-server.pid /etc/hive/conf.server /var/log/hive',
         environment = {'HADOOP_HOME': '/usr',
            'HIVE_BIN': 'hive',
@@ -302,7 +306,11 @@ class TestHiveServer(RMFTestCase):
                        hdp_stack_version = self.STACK_VERSION,
                        target = RMFTestCase.TARGET_COMMON_SERVICES
     )
-    
+    self.assertResourceCalled('Execute',
+                              '/usr/bin/kinit -kt /etc/security/keytabs/hive.service.keytab hive/c6401.ambari.apache.org@EXAMPLE.COM; ',
+                              user = 'hive',
+                              )
+
     self.assertResourceCalled('Execute', "ambari-sudo.sh kill `ambari-sudo.sh su hive -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]cat /var/run/hive/hive-server.pid'`",
         not_if = "! (ls /var/run/hive/hive-server.pid >/dev/null 2>&1 && ps -p `ambari-sudo.sh su hive -l -s /bin/bash -c '[RMF_EXPORT_PLACEHOLDER]cat /var/run/hive/hive-server.pid'` >/dev/null 2>&1)",
     )

http://git-wip-us.apache.org/repos/asf/ambari/blob/64bd2ec1/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json b/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json
index a2c41e4..5d41d03 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json
+++ b/ambari-server/src/test/python/stacks/2.0.6/configs/secured.json
@@ -4,7 +4,8 @@
     "hostname": "c6401.ambari.apache.org", 
     "hostLevelParams": {
         "jdk_location": "http://c6401.ambari.apache.org:8080/resources/", 
-        "ambari_db_rca_password": "mapred", 
+        "ambari_db_rca_password": "mapred",
+        "current_version" : "2.2.4.2-1234",
         "ambari_db_rca_url": "jdbc:postgresql://c6401.ambari.apache.org/ambarirca", 
         "jce_name": "UnlimitedJCEPolicyJDK7.zip", 
         "oracle_jdbc_url": "http://c6401.ambari.apache.org:8080/resources//ojdbc6.jar",