Переглянути джерело

AMBARI-8131. Storm in secure Ambari cluster has config null error when deploying a topology (alejandro)

Alejandro Fernandez 10 роки тому
батько
коміт
18b6518524

+ 1 - 3
ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/scripts/params.py

@@ -60,8 +60,6 @@ if 'ganglia_server_host' in config['clusterHostInfo'] and \
 else:
   ganglia_installed = False
 
-is_compatible_to_2_2_stack = str(config['hostLevelParams']['stack_version']).startswith('2.2')
-
 security_enabled = config['configurations']['cluster-env']['security_enabled']
 
 if security_enabled:
@@ -71,7 +69,7 @@ if security_enabled:
   storm_jaas_principal = _storm_principal_name.replace('_HOST',_hostname_lowercase)
   storm_keytab_path = config['configurations']['storm-env']['storm_keytab']
   
-  if is_compatible_to_2_2_stack:
+  if stack_is_hdp22_or_further:
     storm_ui_keytab_path = config['configurations']['storm-env']['strom_ui_keytab']
     _storm_ui_jaas_principal_name = config['configurations']['storm-env']['strom_ui_principal_name']
     storm_ui_host = default("/clusterHostInfo/storm_ui_server_hosts", [])

+ 2 - 2
ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/scripts/storm.py

@@ -59,7 +59,7 @@ def storm():
     TemplateConfig(format("{conf_dir}/storm_jaas.conf"),
                    owner=params.storm_user
     )
-    if params.is_compatible_to_2_2_stack:
+    if params.stack_is_hdp22_or_further:
       TemplateConfig(format("{conf_dir}/client_jaas.conf"),
                      owner=params.storm_user
       )
@@ -68,7 +68,7 @@ def storm():
       min_user_ruid = int(minRuid) if minRuid.isdigit() else _find_real_user_min_uid()
       
       File(format("{conf_dir}/worker-launcher.cfg"),
-           content=Template("worker-launcher.cfg.j2",min_user_ruid = min_user_ruid), 
+           content=Template("worker-launcher.cfg.j2", min_user_ruid = min_user_ruid),
            owner='root',
            group=params.user_group
       )

+ 3 - 2
ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/templates/client_jaas.conf.j2

@@ -1,4 +1,4 @@
-#
+{#
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -15,9 +15,10 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #}
+
 StormClient {
    com.sun.security.auth.module.Krb5LoginModule required
    useTicketCache=true
    renewTicket=true
-   serviceName="{{nimbus_bare_jaas_principal}}"
+   serviceName="{{nimbus_bare_jaas_principal}}";
 };

+ 2 - 2
ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/templates/storm.yaml.j2

@@ -31,11 +31,11 @@
 {{key}} : {{ escape_yaml_propetry(replace_jaas_placeholder(value)) }}
 {% endfor %}
 
-{% if is_compatible_to_2_2_stack %}
+{% if stack_is_hdp22_or_further %}
 storm.thrift.transport : "{% if security_enabled %}{{configurations['_storm.thrift.secure.transport']}}{% else %}{{configurations['_storm.thrift.nonsecure.transport']}}{% endif %}"  
 {% endif %}
 
-{% if security_enabled and is_compatible_to_2_2_stack %}
+{% if security_enabled and stack_is_hdp22_or_further %}
 #
 # Kerberos security section. For the reference please use: https://github.com/hortonworks/storm/blob/champlain/SECURITY.md for details
 #

+ 1 - 1
ambari-server/src/main/resources/stacks/HDP/2.1/services/STORM/package/templates/storm_jaas.conf.j2

@@ -15,7 +15,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #}
-{% if is_compatible_to_2_2_stack %}
+{% if stack_is_hdp22_or_further %}
 StormServer {
    com.sun.security.auth.module.Krb5LoginModule required
    useKeyTab=true