Przeglądaj źródła

AMBARI-10859. hive-site.xml packaged under /etc/spark/conf is not correct (aonishuk)

Andrew Onishuk 10 lat temu
rodzic
commit
24f2548ae0

+ 19 - 0
ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/params.py

@@ -122,8 +122,27 @@ security_enabled = config['configurations']['cluster-env']['security_enabled']
 kinit_path_local = functions.get_kinit_path(default('/configurations/kerberos-env/executable_search_paths', None))
 spark_kerberos_keytab =  config['configurations']['spark-defaults']['spark.history.kerberos.keytab']
 spark_kerberos_principal =  config['configurations']['spark-defaults']['spark.history.kerberos.principal']
+
+spark_hive_properties = {
+  'hive.metastore.uris': config['configurations']['hive-site']['hive.metastore.uris']
+}
+
 if security_enabled:
   spark_principal = spark_kerberos_principal.replace('_HOST',spark_history_server_host.lower())
+  
+  if is_hive_installed:
+    spark_hive_properties += {
+      'hive.metastore.sasl.enabled': str(config['configurations']['hive-site']['hive.metastore.sasl.enabled']).lower(),
+      'hive.metastore.kerberos.keytab.file': config['configurations']['hive-site']['hive.metastore.kerberos.keytab.file'],
+      'hive.server2.authentication.spnego.principal': config['configurations']['hive-site']['hive.server2.authentication.spnego.principal'],
+      'hive.server2.authentication.spnego.keytab': config['configurations']['hive-site']['hive.server2.authentication.spnego.keytab'],
+      'hive.metastore.kerberos.principal': config['configurations']['hive-site']['hive.metastore.kerberos.principal'],
+      'hive.server2.authentication.kerberos.principal': config['configurations']['hive-site']['hive.server2.authentication.kerberos.principal'],
+      'hive.server2.authentication.kerberos.keytab': config['configurations']['hive-site']['hive.server2.authentication.kerberos.keytab'],
+      'hive.security.authorization.enabled': spark_hive_sec_authorization_enabled,
+      'hive.server2.enable.doAs': str(config['configurations']['hive-site']['hive.server2.enable.doAs']).lower()
+    }
+  
 
 
 

+ 1 - 1
ambari-server/src/main/resources/common-services/SPARK/1.2.0.2.2/package/scripts/setup_spark.py

@@ -78,7 +78,7 @@ def setup_spark(env, type, action = None):
   if params.is_hive_installed:
     XmlConfig("hive-site.xml",
               conf_dir=params.spark_conf,
-              configurations=params.config['configurations']['hive-site'],
+              configurations=params.spark_hive_properties,
               owner=params.spark_user,
               group=params.spark_group,
               mode=0644)