You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ad...@apache.org on 2018/09/25 17:32:50 UTC

[ambari] branch branch-2.7 updated: AMBARI-24548. Allow skipping Hive Metastore schema creation for sysprepped cluster (#2218)

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

adoroszlai pushed a commit to branch branch-2.7
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/branch-2.7 by this push:
     new 9904962  AMBARI-24548. Allow skipping Hive Metastore schema creation for sysprepped cluster (#2218)
9904962 is described below

commit 990496261fcd42ff4c123535b5a2aaf6d8c584b0
Author: Doroszlai, Attila <64...@users.noreply.github.com>
AuthorDate: Tue Sep 25 19:32:42 2018 +0200

    AMBARI-24548. Allow skipping Hive Metastore schema creation for sysprepped cluster (#2218)
---
 .../common-services/HIVE/0.12.0.2.0/package/scripts/hive.py   |  4 ++++
 .../common-services/HIVE/0.12.0.2.0/package/scripts/params.py |  2 ++
 .../resources/stacks/HDP/2.0.6/configuration/cluster-env.xml  | 11 +++++++++++
 3 files changed, 17 insertions(+)

diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
index 7f93b05..93d6c6c 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive.py
@@ -348,6 +348,10 @@ def setup_metastore():
 def create_metastore_schema():
   import params
 
+  if params.sysprep_skip_hive_schema_create:
+    Logger.info("Skipping creation of Hive Metastore schema as host is sys prepped")
+    return
+
   create_schema_cmd = format("export HIVE_CONF_DIR={hive_server_conf_dir} ; "
                              "{hive_schematool_bin}/schematool -initSchema "
                              "-dbType {hive_metastore_db_type} "
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py
index 895ec81..efc99fe 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params.py
@@ -26,5 +26,7 @@ if OSCheck.is_windows_family():
 else:
   from params_linux import *
 
+host_sys_prepped = default("/ambariLevelParams/host_sys_prepped", False)
+sysprep_skip_hive_schema_create = host_sys_prepped and default("/configurations/cluster-env/sysprep_skip_hive_schema_create", False)
 sysprep_skip_copy_tarballs_hdfs = get_sysprep_skip_copy_tarballs_hdfs()
 retryAble = default("/commandParams/command_retry_enabled", False)
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
index 1c33171..4688791 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/configuration/cluster-env.xml
@@ -137,6 +137,17 @@
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
+    <name>sysprep_skip_hive_schema_create</name>
+    <display-name>Whether to skip creating the Hive Metastore DB schema on sysprepped cluster</display-name>
+    <value>false</value>
+    <description>Whether to skip creating the Hive Metastore DB schema on sysprepped cluster, during fresh install</description>
+    <value-attributes>
+      <overridable>true</overridable>
+      <type>boolean</type>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
     <name>sysprep_skip_setup_jce</name>
     <display-name>Whether to skip setting up the unlimited key JCE policy on sysprepped cluster</display-name>
     <value>false</value>