Repository: ambari
Updated Branches:
  refs/heads/trunk 076ed757b -> 66124ac8a


AMBARI-19162. LogSearch - use fully qualified hostname instead of localhost for 
spnego.host (oleewere)

Change-Id: I07599997c4358213cd300bdc3c9179afa15e9acd


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

Branch: refs/heads/trunk
Commit: 66124ac8a31894637ed95094d1e40d9e7e86a791
Parents: 076ed75
Author: oleewere <[email protected]>
Authored: Mon Dec 12 17:19:24 2016 +0100
Committer: oleewere <[email protected]>
Committed: Mon Dec 12 17:22:30 2016 +0100

----------------------------------------------------------------------
 .../LOGSEARCH/0.5.0/configuration/logsearch-properties.xml      | 2 +-
 .../common-services/LOGSEARCH/0.5.0/package/scripts/params.py   | 5 ++++-
 .../src/test/python/stacks/2.4/LOGSEARCH/test_logsearch.py      | 3 ++-
 ambari-server/src/test/python/stacks/2.4/configs/default.json   | 1 +
 4 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/66124ac8/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml
 
b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml
index b474c5d..8fc71d5 100644
--- 
a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml
+++ 
b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-properties.xml
@@ -268,7 +268,7 @@
   </property>
   <property>
     <name>logsearch.spnego.kerberos.host</name>
-    <value>localhost</value>
+    <value>_HOST</value>
     <display-name>Http Spnego hostname</display-name>
     <description>Fully-qualified host name in the Kerberos service principal 
name (SPN) that is used by SPNEGO</description>
     <value-attributes>

http://git-wip-us.apache.org/repos/asf/ambari/blob/66124ac8/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py
 
b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py
index c20d92d..4d751ba 100644
--- 
a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py
+++ 
b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/package/scripts/params.py
@@ -86,9 +86,9 @@ if 'infra-solr-env' in config['configurations']:
   infra_solr_ssl_enabled = 
default('configurations/infra-solr-env/infra_solr_ssl_enabled', False)
   infra_solr_jmx_port = 
config['configurations']['infra-solr-env']['infra_solr_jmx_port']
 
+_hostname_lowercase = config['hostname'].lower()
 if security_enabled:
   kinit_path_local = status_params.kinit_path_local
-  _hostname_lowercase = config['hostname'].lower()
   logsearch_jaas_file = logsearch_server_conf + '/logsearch_jaas.conf'
   logfeeder_jaas_file = logsearch_logfeeder_conf + '/logfeeder_jaas.conf'
   use_external_solr_with_kerberos = 
default('configurations/logsearch-env/logsearch_external_solr_kerberos_enabled',
 False)
@@ -103,6 +103,8 @@ if security_enabled:
     logfeeder_kerberos_keytab = 
config['configurations']['logfeeder-env']['logfeeder_kerberos_keytab']
     logfeeder_kerberos_principal = 
config['configurations']['logfeeder-env']['logfeeder_kerberos_principal'].replace('_HOST',_hostname_lowercase)
 
+logsearch_spnego_host = 
config['configurations']['logsearch-properties']['logsearch.spnego.kerberos.host'].replace('_HOST',
 _hostname_lowercase)
+
 #####################################
 # Logsearch configs
 #####################################
@@ -222,6 +224,7 @@ del 
logsearch_properties['logsearch.solr.audit.logs.use.ranger']
 
 logsearch_properties['logsearch.solr.metrics.collector.hosts'] = 
format(logsearch_properties['logsearch.solr.metrics.collector.hosts'])
 logsearch_properties['logsearch.auth.external_auth.host_url'] = 
format(logsearch_properties['logsearch.auth.external_auth.host_url'])
+logsearch_properties['logsearch.spnego.kerberos.host'] = logsearch_spnego_host
 
 if logsearch_solr_kerberos_enabled:
   logsearch_properties['logsearch.solr.kerberos.enable'] = 'true'

http://git-wip-us.apache.org/repos/asf/ambari/blob/66124ac8/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logsearch.py
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logsearch.py 
b/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logsearch.py
index df54cd8..c3e8930 100644
--- a/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logsearch.py
+++ b/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logsearch.py
@@ -94,7 +94,8 @@ class TestLogSearch(RMFTestCase):
                                             
'logsearch.solr.history.config.name': 'history',
                                             
'logsearch.solr.metrics.collector.hosts': '',
                                             'logsearch.solr.jmx.port': '1',
-                                            
'logsearch.solr.zk_connect_string': 'c6401.ambari.apache.org:2181/infra-solr'
+                                            
'logsearch.solr.zk_connect_string': 'c6401.ambari.apache.org:2181/infra-solr',
+                                            'logsearch.spnego.kerberos.host': 
'localhost'
                               }
     )
     self.assertResourceCalled('File', 
'/etc/ambari-logsearch-portal/conf/HadoopServiceConfig.json',

http://git-wip-us.apache.org/repos/asf/ambari/blob/66124ac8/ambari-server/src/test/python/stacks/2.4/configs/default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.4/configs/default.json 
b/ambari-server/src/test/python/stacks/2.4/configs/default.json
index 1dbc611..7591adb 100644
--- a/ambari-server/src/test/python/stacks/2.4/configs/default.json
+++ b/ambari-server/src/test/python/stacks/2.4/configs/default.json
@@ -286,6 +286,7 @@
         "content": "&lt;?xml version=\"1.0\" encoding=\"UTF-8\" 
?&gt;\n&lt;!--\n  Licensed to the Apache Software Foundation (ASF) under one or 
more\n  contributor license agreements.  See the NOTICE file distributed with\n 
 this work for additional information regarding copyright ownership.\n  The ASF 
licenses this file to You under the Apache License, Version 2.0\n  (the 
\"License\"); you may not use this file except in compliance with\n  the 
License.  You may obtain a copy of the License at\n\n      
http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable 
law or agreed to in writing, software\n  distributed under the License is 
distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express or implied.\n  See the License for the specific language 
governing permissions and\n  limitations under the 
License.\n--&gt;\n&lt;!DOCTYPE log4j:configuration SYSTEM 
\"log4j.dtd\"&gt;\n&lt;log4j:configuration xmlns:log4j=\"http://jakarta.
 apache.org/log4j/\"&gt;\n  &lt;appender name=\"console\" 
class=\"org.apache.log4j.ConsoleAppender\"&gt;\n    &lt;param name=\"Target\" 
value=\"System.out\" /&gt;\n    &lt;layout 
class=\"org.apache.log4j.PatternLayout\"&gt;\n      &lt;param 
name=\"ConversionPattern\" value=\"%d [%t] %-5p %C{6} (%F:%L) - %m%n\" /&gt;\n  
  &lt;/layout&gt;\n  &lt;/appender&gt;\n\n  &lt;appender name=\"rolling_file\" 
class=\"org.apache.log4j.RollingFileAppender\"&gt; \n    &lt;param 
name=\"file\" value=\"{{logsearch_log_dir}}/logsearch.log\" /&gt; \n    
&lt;param name=\"append\" value=\"true\" /&gt; \n    &lt;param 
name=\"maxFileSize\" value=\"10MB\" /&gt; \n    &lt;param 
name=\"maxBackupIndex\" value=\"10\" /&gt; \n    &lt;layout 
class=\"org.apache.log4j.PatternLayout\"&gt; \n      &lt;param 
name=\"ConversionPattern\" value=\"%d [%t] %-5p %C{6} (%F:%L) - %m%n\"/&gt; \n  
  &lt;/layout&gt; \n  &lt;/appender&gt; \n\n  &lt;appender 
name=\"performance_analyzer\" class=\"org.apache.log4j.RollingFileAppender\"
 &gt;\n    &lt;param name=\"file\" 
value=\"{{logsearch_log_dir}}/logsearch-performance.log\" /&gt;\n    &lt;param 
name=\"Threshold\" value=\"info\" /&gt;\n    &lt;param name=\"append\" 
value=\"true\" /&gt;\n    &lt;param name=\"maxFileSize\" value=\"10MB\" /&gt; 
\n    &lt;param name=\"maxBackupIndex\" value=\"10\" /&gt; \n    &lt;layout 
class=\"org.apache.log4j.PatternLayout\"&gt;\n      &lt;param 
name=\"ConversionPattern\" value=\"%d [%t] %-5p %C{6} (%F:%L) - %m%n\" /&gt;\n  
  &lt;/layout&gt;\n  &lt;/appender&gt;\n  \n  &lt;logger 
name=\"org.apache.ambari.logsearch.perfomance\" additivity=\"false\"&gt;\n   
&lt;appender-ref ref=\"performance_analyzer\" /&gt;\n  &lt;/logger&gt;\n\n  
&lt;category name=\"org.apache.ambari.logsearch\" additivity=\"false\"&gt;\n    
&lt;priority value=\"info\" /&gt;\n    &lt;appender-ref ref=\"rolling_file\" 
/&gt;\n  &lt;/category&gt;\n\n  &lt;root&gt;\n    &lt;priority value=\"warn\" 
/&gt;\n    &lt;appender-ref ref=\"rolling_file\" /&gt;\n  &lt;/root&gt;\
 n&lt;/log4j:configuration&gt;"
       },
       "logsearch-properties": {
+        "logsearch.spnego.kerberos.host" : "localhost",
         "logsearch.solr.collection.service.logs" : "hadoop_logs",
         "logsearch.solr.collection.audit.logs" : "audit_logs",
         "logsearch.service.logs.split.interval.mins": "1",

Reply via email to