AMBARI-20742 Log Search common properties (mgergely) Change-Id: I4fb2fa150890d528ea6499e6348bf0be0d74ccb5
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d499c8a6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d499c8a6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d499c8a6 Branch: refs/heads/branch-feature-AMBARI-12556 Commit: d499c8a68229fe44b3909b51a2cf3b90b7e92b9a Parents: 3d5da62 Author: Miklos Gergely <mgerg...@hortonworks.com> Authored: Fri Apr 21 13:09:53 2017 +0200 Committer: Miklos Gergely <mgerg...@hortonworks.com> Committed: Fri Apr 21 13:10:08 2017 +0200 ---------------------------------------------------------------------- .../logsearch-common-properties.xml | 23 ++++++++++++++++++++ .../LOGSEARCH/0.5.0/package/scripts/params.py | 8 +++++-- .../stacks/2.4/LOGSEARCH/test_logfeeder.py | 1 + .../stacks/2.4/LOGSEARCH/test_logsearch.py | 3 ++- .../test/python/stacks/2.4/configs/default.json | 3 +++ 5 files changed, 35 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/d499c8a6/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-common-properties.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-common-properties.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-common-properties.xml new file mode 100644 index 0000000..0087028 --- /dev/null +++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-common-properties.xml @@ -0,0 +1,23 @@ +<?xml version="1.0"?> +<?xml-stylesheet type="text/xsl" href="configuration.xsl"?> +<!-- +/** + * 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 + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--> +<configuration> +</configuration> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/d499c8a6/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 84a6ad9..7d4aefc 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 @@ -257,7 +257,9 @@ logsearch_properties['logsearch.protocol'] = logsearch_ui_protocol # load config values -logsearch_properties = dict(logsearch_properties.items() + dict(config['configurations']['logsearch-properties']).items()) +logsearch_properties = dict(logsearch_properties.items() +\ + dict(config['configurations']['logsearch-common-properties']).items() +\ + dict(config['configurations']['logsearch-properties']).items()) # load derivated values @@ -347,7 +349,9 @@ logfeeder_properties['logfeeder.solr.core.config.name'] = 'history' # load config values -logfeeder_properties = dict(logfeeder_properties.items() + dict(config['configurations']['logfeeder-properties']).items()) +logfeeder_properties = dict(logfeeder_properties.items() +\ + dict(config['configurations']['logsearch-common-properties']).items() +\ + dict(config['configurations']['logfeeder-properties']).items()) # load derivated values http://git-wip-us.apache.org/repos/asf/ambari/blob/d499c8a6/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logfeeder.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logfeeder.py b/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logfeeder.py index 662e4a7..159cb81 100644 --- a/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logfeeder.py +++ b/ambari-server/src/test/python/stacks/2.4/LOGSEARCH/test_logfeeder.py @@ -68,6 +68,7 @@ class TestLogFeeder(RMFTestCase): ) self.assertResourceCalled('PropertiesFile', '/etc/ambari-logsearch-logfeeder/conf/logfeeder.properties', properties={'cluster.name': 'c1', + 'common-property': 'common-value', 'hadoop.security.credential.provider.path': 'jceks://file/etc/ambari-logsearch-logfeeder/conf/logfeeder.jceks', 'logfeeder.checkpoint.folder': '/etc/ambari-logsearch-logfeeder/conf/checkpoints', 'logfeeder.config.dir': '/etc/ambari-logsearch-logfeeder/conf', http://git-wip-us.apache.org/repos/asf/ambari/blob/d499c8a6/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 52ac316..afdc42f 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 @@ -83,7 +83,8 @@ class TestLogSearch(RMFTestCase): action = ['delete'] ) self.assertResourceCalled('PropertiesFile', '/etc/ambari-logsearch-portal/conf/logsearch.properties', - properties = {'hadoop.security.credential.provider.path': 'jceks://file/etc/ambari-logsearch-portal/conf/logsearch.jceks', + properties = {'common-property': 'common-value', + 'hadoop.security.credential.provider.path': 'jceks://file/etc/ambari-logsearch-portal/conf/logsearch.jceks', 'logsearch.audit.logs.split.interval.mins': '1', 'logsearch.auth.external_auth.enabled': 'false', 'logsearch.auth.external_auth.host_url': 'http://c6401.ambari.apache.org:8080', http://git-wip-us.apache.org/repos/asf/ambari/blob/d499c8a6/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 8822e96..1863c02 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 @@ -292,6 +292,9 @@ "logsearch-log4j": { "content": "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!--\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-->\n<!DOCTYPE log4j:configuration SYSTEM \"log4j.dtd\">\n<log4j:configuration xmlns:log4j=\"http://jakarta. apache.org/log4j/\">\n <appender name=\"console\" class=\"org.apache.log4j.ConsoleAppender\">\n <param name=\"Target\" value=\"System.out\" />\n <layout class=\"org.apache.log4j.PatternLayout\">\n <param name=\"ConversionPattern\" value=\"%d [%t] %-5p %C{6} (%F:%L) - %m%n\" />\n </layout>\n </appender>\n\n <appender name=\"rolling_file\" class=\"org.apache.log4j.RollingFileAppender\"> \n <param name=\"file\" value=\"{{logsearch_log_dir}}/logsearch.log\" /> \n <param name=\"append\" value=\"true\" /> \n <param name=\"maxFileSize\" value=\"10MB\" /> \n <param name=\"maxBackupIndex\" value=\"10\" /> \n <layout class=\"org.apache.log4j.PatternLayout\"> \n <param name=\"ConversionPattern\" value=\"%d [%t] %-5p %C{6} (%F:%L) - %m%n\"/> \n </layout> \n </appender> \n\n <appender name=\"performance_analyzer\" class=\"org.apache.log4j.RollingFileAppender\" >\n <param name=\"file\" value=\"{{logsearch_log_dir}}/logsearch-performance.log\" />\n <param name=\"Threshold\" value=\"info\" />\n <param name=\"append\" value=\"true\" />\n <param name=\"maxFileSize\" value=\"10MB\" /> \n <param name=\"maxBackupIndex\" value=\"10\" /> \n <layout class=\"org.apache.log4j.PatternLayout\">\n <param name=\"ConversionPattern\" value=\"%d [%t] %-5p %C{6} (%F:%L) - %m%n\" />\n </layout>\n </appender>\n \n <logger name=\"org.apache.ambari.logsearch.perfomance\" additivity=\"false\">\n <appender-ref ref=\"performance_analyzer\" />\n </logger>\n\n <category name=\"org.apache.ambari.logsearch\" additivity=\"false\">\n <priority value=\"info\" />\n <appender-ref ref=\"rolling_file\" />\n </category>\n\n <root>\n <priority value=\"warn\" />\n <appender-ref ref=\"rolling_file\" />\n </root>\ n</log4j:configuration>" }, + "logsearch-common-properties": { + "common-property": "common-value" + }, "logsearch-properties": { "logsearch.spnego.kerberos.host" : "localhost", "logsearch.solr.collection.service.logs" : "hadoop_logs",