This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/branch-2.6 by this push:
new d622164 AMBARI-24548. Allow skipping Hive Metastore schema creation
for sysprepped cluster (#2199)
d622164 is described below
commit d6221644397d26a38c3b2f34b8fa867d5838ce8f
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Thu Aug 30 22:19:03 2018 +0200
AMBARI-24548. Allow skipping Hive Metastore schema creation for sysprepped
cluster (#2199)
---
.../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 b8d8361..5d5c9b0 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
@@ -391,6 +391,10 @@ def hive(name=None):
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..14a4a71 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("/hostLevelParams/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 89cf70d..591b9f5 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>