Repository: ambari Updated Branches: refs/heads/branch-2.5 82e44131a -> 5c3d7dbcf
AMBARI-19209 Separate general Log Search env properties from Log Search Portal properties Change-Id: Id9b779d7aab3a43ca876dd39f3eb316e5ff432a9 Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5c3d7dbc Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5c3d7dbc Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5c3d7dbc Branch: refs/heads/branch-2.5 Commit: 5c3d7dbcf32aabbb0aa7ab308635ee0a38b758c8 Parents: 82e4413 Author: Miklos Gergely <[email protected]> Authored: Sat Dec 31 00:57:02 2016 +0100 Committer: Miklos Gergely <[email protected]> Committed: Sat Dec 31 00:57:02 2016 +0100 ---------------------------------------------------------------------- .../0.5.0/configuration/logfeeder-env.xml | 2 +- .../configuration/logsearch-common-env.xml | 104 +++++++++++++++++++ .../0.5.0/configuration/logsearch-env.xml | 80 -------------- .../LOGSEARCH/0.5.0/metainfo.xml | 3 +- .../LOGSEARCH/0.5.0/package/scripts/params.py | 12 +-- .../LOGSEARCH/0.5.0/themes/theme.json | 52 +++++----- .../stacks/HDP/2.2/services/stack_advisor.py | 11 +- .../stacks/2.3/common/test_stack_advisor.py | 6 +- 8 files changed, 148 insertions(+), 122 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/5c3d7dbc/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-env.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-env.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-env.xml index aba638a..bc65e3c 100644 --- a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-env.xml +++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logfeeder-env.xml @@ -149,7 +149,7 @@ <property> <name>content</name> <display-name>logfeeder-env template</display-name> - <description>This is the jinja template for logsearch-env.sh file</description> + <description>This is the jinja template for logfeeder-env.sh file</description> <value/> <property-type>VALUE_FROM_PROPERTY_FILE</property-type> <value-attributes> http://git-wip-us.apache.org/repos/asf/ambari/blob/5c3d7dbc/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-common-env.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-common-env.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-common-env.xml new file mode 100644 index 0000000..1c6c2ef --- /dev/null +++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-common-env.xml @@ -0,0 +1,104 @@ +<?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. + */ +--> +<!-- This is a special config file for properties used to monitor status of the service --> +<configuration supports_adding_forbidden="true"> + <property> + <name>logsearch_use_external_solr</name> + <value>false</value> + <display-name>Use External Solr</display-name> + <description>Use External Solr to store logs</description> + <value-attributes> + <type>value-list</type> + <overridable>false</overridable> + <entries> + <entry> + <value>true</value> + <label>ON</label> + </entry> + <entry> + <value>false</value> + <label>OFF</label> + </entry> + </entries> + <selection-cardinality>1</selection-cardinality> + </value-attributes> + <on-ambari-upgrade add="true"/> + </property> + <property> + <name>logsearch_external_solr_zk_znode</name> + <value></value> + <display-name>External Solr Logs Znode</display-name> + <description>Only needed if using custom solr cloud. E.g. /logsearch_solr</description> + <on-ambari-upgrade add="true"/> + </property> + <property> + <name>logsearch_external_solr_zk_quorum</name> + <value></value> + <display-name>External Solr Logs ZK Quorum</display-name> + <description>Only needed if using custom solr cloud. E.g. zk1:2181,zk2:2182</description> + <on-ambari-upgrade add="true"/> + </property> + <property> + <name>logsearch_external_solr_ssl_enabled</name> + <value>false</value> + <display-name>Log Search External Solr SSL Enabled</display-name> + <description>Use SSL to connect to the external solr</description> + <value-attributes> + <type>value-list</type> + <overridable>false</overridable> + <entries> + <entry> + <value>true</value> + <label>ON</label> + </entry> + <entry> + <value>false</value> + <label>OFF</label> + </entry> + </entries> + <selection-cardinality>1</selection-cardinality> + </value-attributes> + <on-ambari-upgrade add="true"/> + </property> + <property> + <name>logsearch_external_solr_kerberos_enabled</name> + <value>false</value> + <display-name>Log Search External Solr Kerberos Enabled</display-name> + <description>Use Kerberos to connect to the external solr</description> + <value-attributes> + <type>value-list</type> + <overridable>false</overridable> + <entries> + <entry> + <value>true</value> + <label>ON</label> + </entry> + <entry> + <value>false</value> + <label>OFF</label> + </entry> + </entries> + <selection-cardinality>1</selection-cardinality> + </value-attributes> + <on-ambari-upgrade add="true"/> + </property> +</configuration> http://git-wip-us.apache.org/repos/asf/ambari/blob/5c3d7dbc/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-env.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-env.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-env.xml index 8691d35..a6f1502 100644 --- a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-env.xml +++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/configuration/logsearch-env.xml @@ -99,86 +99,6 @@ <on-ambari-upgrade add="true"/> </property> <property> - <name>logsearch_use_external_solr</name> - <value>false</value> - <display-name>Use External Solr</display-name> - <description>Use External Solr to store logs</description> - <value-attributes> - <type>value-list</type> - <overridable>false</overridable> - <entries> - <entry> - <value>true</value> - <label>ON</label> - </entry> - <entry> - <value>false</value> - <label>OFF</label> - </entry> - </entries> - <selection-cardinality>1</selection-cardinality> - </value-attributes> - <on-ambari-upgrade add="true"/> - </property> - <property> - <name>logsearch_external_solr_zk_znode</name> - <value></value> - <display-name>External Solr Logs Znode</display-name> - <description>Only needed if using custom solr cloud. E.g. /logsearch_solr</description> - <on-ambari-upgrade add="true"/> - </property> - <property> - <name>logsearch_external_solr_zk_quorum</name> - <value></value> - <display-name>External Solr Logs ZK Quorum</display-name> - <description>Only needed if using custom solr cloud. E.g. zk1:2181,zk2:2182</description> - <on-ambari-upgrade add="true"/> - </property> - <property> - <name>logsearch_external_solr_ssl_enabled</name> - <value>false</value> - <display-name>Log Search External Solr SSL Enabled</display-name> - <description>Use SSL to connect to the external solr</description> - <value-attributes> - <type>value-list</type> - <overridable>false</overridable> - <entries> - <entry> - <value>true</value> - <label>ON</label> - </entry> - <entry> - <value>false</value> - <label>OFF</label> - </entry> - </entries> - <selection-cardinality>1</selection-cardinality> - </value-attributes> - <on-ambari-upgrade add="true"/> - </property> - <property> - <name>logsearch_external_solr_kerberos_enabled</name> - <value>false</value> - <display-name>Log Search External Solr Kerberos Enabled</display-name> - <description>Use Kerberos to connect to the external solr</description> - <value-attributes> - <type>value-list</type> - <overridable>false</overridable> - <entries> - <entry> - <value>true</value> - <label>ON</label> - </entry> - <entry> - <value>false</value> - <label>OFF</label> - </entry> - </entries> - <selection-cardinality>1</selection-cardinality> - </value-attributes> - <on-ambari-upgrade add="true"/> - </property> - <property> <name>logsearch_external_solr_kerberos_keytab</name> <value></value> <display-name>Log Search External Solr keytab</display-name> http://git-wip-us.apache.org/repos/asf/ambari/blob/5c3d7dbc/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/metainfo.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/metainfo.xml b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/metainfo.xml index 6921a8e..ebf5404 100644 --- a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/metainfo.xml +++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/metainfo.xml @@ -60,6 +60,7 @@ <config-type>infra-solr-env</config-type> <config-type>logsearch-properties</config-type> <config-type>logsearch-env</config-type> + <config-type>logsearch-common-env</config-type> <config-type>logsearch-log4j</config-type> <config-type>logsearch-admin-json</config-type> <config-type>logsearch-service_logs-solrconfig.xml</config-type> @@ -88,7 +89,7 @@ <configuration-dependencies> <config-type>infra-solr-env</config-type> - <config-type>logsearch-env</config-type> + <config-type>logsearch-common-env</config-type> <config-type>logfeeder-properties</config-type> <config-type>logfeeder-env</config-type> <config-type>logfeeder-grok</config-type> http://git-wip-us.apache.org/repos/asf/ambari/blob/5c3d7dbc/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 10ba541..ff88abc 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 @@ -91,7 +91,7 @@ if security_enabled: kinit_path_local = status_params.kinit_path_local 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) + use_external_solr_with_kerberos = default('configurations/logsearch-common-env/logsearch_external_solr_kerberos_enabled', False) if use_external_solr_with_kerberos: logsearch_kerberos_keytab = config['configurations']['logsearch-env']['logsearch_external_solr_kerberos_keytab'] logsearch_kerberos_principal = config['configurations']['logsearch-env']['logsearch_external_solr_kerberos_principal'].replace('_HOST',_hostname_lowercase) @@ -116,13 +116,13 @@ logsearch_service_logs_merge_factor = config['configurations']['logsearch-servic logsearch_audit_logs_max_retention = config['configurations']['logsearch-audit_logs-solrconfig']['logsearch_audit_logs_max_retention'] logsearch_audit_logs_merge_factor = config['configurations']['logsearch-audit_logs-solrconfig']['logsearch_audit_logs_merge_factor'] -logsearch_use_external_solr = default('/configurations/logsearch-env/logsearch_use_external_solr', False) +logsearch_use_external_solr = default('/configurations/logsearch-common-env/logsearch_use_external_solr', False) if logsearch_use_external_solr: - logsearch_solr_zk_znode = config['configurations']['logsearch-env']['logsearch_external_solr_zk_znode'] - logsearch_solr_zk_quorum = config['configurations']['logsearch-env']['logsearch_external_solr_zk_quorum'] - logsearch_solr_ssl_enabled = default('configurations/logsearch-env/logsearch_external_solr_ssl_enabled', False) - logsearch_solr_kerberos_enabled = security_enabled and default('configurations/logsearch-env/logsearch_external_solr_kerberos_enabled', False) + logsearch_solr_zk_znode = config['configurations']['logsearch-common-env']['logsearch_external_solr_zk_znode'] + logsearch_solr_zk_quorum = config['configurations']['logsearch-common-env']['logsearch_external_solr_zk_quorum'] + logsearch_solr_ssl_enabled = default('configurations/logsearch-common-env/logsearch_external_solr_ssl_enabled', False) + logsearch_solr_kerberos_enabled = security_enabled and use_external_solr_with_kerberos else: logsearch_solr_zk_znode = infra_solr_znode http://git-wip-us.apache.org/repos/asf/ambari/blob/5c3d7dbc/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/themes/theme.json ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/themes/theme.json b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/themes/theme.json index 2858825..0adcbde 100644 --- a/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/themes/theme.json +++ b/ambari-server/src/main/resources/common-services/LOGSEARCH/0.5.0/themes/theme.json @@ -159,18 +159,18 @@ ] }, { - "config": "logsearch-env/logsearch_use_external_solr", + "config": "logsearch-common-env/logsearch_use_external_solr", "subsection-name": "subsection-logsearch-solr-connection-col1" }, { - "config": "logsearch-env/logsearch_external_solr_zk_znode", + "config": "logsearch-common-env/logsearch_external_solr_zk_znode", "subsection-name": "subsection-logsearch-solr-connection-col1", "depends-on": [ { "configs":[ - "logsearch-env/logsearch_use_external_solr" + "logsearch-common-env/logsearch_use_external_solr" ], - "if": "${logsearch-env/logsearch_use_external_solr}", + "if": "${logsearch-common-env/logsearch_use_external_solr}", "then": { "property_value_attributes": { "visible": true @@ -185,14 +185,14 @@ ] }, { - "config": "logsearch-env/logsearch_external_solr_zk_quorum", + "config": "logsearch-common-env/logsearch_external_solr_zk_quorum", "subsection-name": "subsection-logsearch-solr-connection-col1", "depends-on": [ { "configs":[ - "logsearch-env/logsearch_use_external_solr" + "logsearch-common-env/logsearch_use_external_solr" ], - "if": "${logsearch-env/logsearch_use_external_solr}", + "if": "${logsearch-common-env/logsearch_use_external_solr}", "then": { "property_value_attributes": { "visible": true @@ -207,14 +207,14 @@ ] }, { - "config": "logsearch-env/logsearch_external_solr_ssl_enabled", + "config": "logsearch-common-env/logsearch_external_solr_ssl_enabled", "subsection-name": "subsection-logsearch-solr-connection-col1", "depends-on": [ { "configs":[ - "logsearch-env/logsearch_use_external_solr" + "logsearch-common-env/logsearch_use_external_solr" ], - "if": "${logsearch-env/logsearch_use_external_solr}", + "if": "${logsearch-common-env/logsearch_use_external_solr}", "then": { "property_value_attributes": { "visible": true @@ -229,14 +229,14 @@ ] }, { - "config": "logsearch-env/logsearch_external_solr_kerberos_enabled", + "config": "logsearch-common-env/logsearch_external_solr_kerberos_enabled", "subsection-name": "subsection-logsearch-solr-connection-col1", "depends-on": [ { "configs":[ - "logsearch-env/logsearch_use_external_solr" + "logsearch-common-env/logsearch_use_external_solr" ], - "if": "${logsearch-env/logsearch_use_external_solr}", + "if": "${logsearch-common-env/logsearch_use_external_solr}", "then": { "property_value_attributes": { "visible": true @@ -256,9 +256,9 @@ "depends-on": [ { "configs":[ - "logsearch-env/logsearch_external_solr_kerberos_enabled" + "logsearch-common-env/logsearch_external_solr_kerberos_enabled" ], - "if": "${logsearch-env/logsearch_external_solr_kerberos_enabled}", + "if": "${logsearch-common-env/logsearch_external_solr_kerberos_enabled}", "then": { "property_value_attributes": { "visible": true @@ -278,9 +278,9 @@ "depends-on": [ { "configs":[ - "logsearch-env/logsearch_external_solr_kerberos_enabled" + "logsearch-common-env/logsearch_external_solr_kerberos_enabled" ], - "if": "${logsearch-env/logsearch_external_solr_kerberos_enabled}", + "if": "${logsearch-common-env/logsearch_external_solr_kerberos_enabled}", "then": { "property_value_attributes": { "visible": true @@ -300,9 +300,9 @@ "depends-on": [ { "configs":[ - "logsearch-env/logsearch_external_solr_kerberos_enabled" + "logsearch-common-env/logsearch_external_solr_kerberos_enabled" ], - "if": "${logsearch-env/logsearch_external_solr_kerberos_enabled}", + "if": "${logsearch-common-env/logsearch_external_solr_kerberos_enabled}", "then": { "property_value_attributes": { "visible": true @@ -322,9 +322,9 @@ "depends-on": [ { "configs":[ - "logsearch-env/logsearch_external_solr_kerberos_enabled" + "logsearch-common-env/logsearch_external_solr_kerberos_enabled" ], - "if": "${logsearch-env/logsearch_external_solr_kerberos_enabled}", + "if": "${logsearch-common-env/logsearch_external_solr_kerberos_enabled}", "then": { "property_value_attributes": { "visible": true @@ -421,31 +421,31 @@ } }, { - "config": "logsearch-env/logsearch_use_external_solr", + "config": "logsearch-common-env/logsearch_use_external_solr", "widget": { "type": "toggle" } }, { - "config": "logsearch-env/logsearch_external_solr_zk_znode", + "config": "logsearch-common-env/logsearch_external_solr_zk_znode", "widget": { "type": "text-field" } }, { - "config": "logsearch-env/logsearch_external_solr_zk_quorum", + "config": "logsearch-common-env/logsearch_external_solr_zk_quorum", "widget": { "type": "text-field" } }, { - "config": "logsearch-env/logsearch_external_solr_ssl_enabled", + "config": "logsearch-common-env/logsearch_external_solr_ssl_enabled", "widget": { "type": "toggle" } }, { - "config": "logsearch-env/logsearch_external_solr_kerberos_enabled", + "config": "logsearch-common-env/logsearch_external_solr_kerberos_enabled", "widget": { "type": "toggle" } http://git-wip-us.apache.org/repos/asf/ambari/blob/5c3d7dbc/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py index 6ae10b3..6f91ca8 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py @@ -1027,7 +1027,8 @@ class HDP22StackAdvisor(HDP21StackAdvisor): def recommendLogsearchConfigurations(self, configurations, clusterData, services, hosts): putLogsearchProperty = self.putProperty(configurations, "logsearch-properties", services) putLogsearchAttribute = self.putPropertyAttribute(configurations, "logsearch-properties") - putLogsearchEnvProperty = self.putProperty(configurations, "logsearch-env", services) + putLogsearchCommonEnvProperty = self.putProperty(configurations, "logsearch-common-env", services) + putLogsearchCommonEnvAttribute = self.putPropertyAttribute(configurations, "logsearch-common-env") putLogsearchEnvAttribute = self.putPropertyAttribute(configurations, "logsearch-env") putLogfeederEnvAttribute = self.putPropertyAttribute(configurations, "logfeeder-env") @@ -1047,8 +1048,8 @@ class HDP22StackAdvisor(HDP21StackAdvisor): recommendedShards = 1 recommendedMaxShards = 100 - putLogsearchEnvProperty('logsearch_use_external_solr', 'true') - putLogsearchEnvAttribute('logsearch_use_external_solr', 'visible', 'false') + putLogsearchCommonEnvProperty('logsearch_use_external_solr', 'true') + putLogsearchCommonEnvAttribute('logsearch_use_external_solr', 'visible', 'false') # recommend number of shard putLogsearchAttribute('logsearch.collection.service.logs.numshards', 'minimum', recommendedMinShards) @@ -1064,8 +1065,8 @@ class HDP22StackAdvisor(HDP21StackAdvisor): kerberos_authentication_enabled = self.isSecurityEnabled(services) if not kerberos_authentication_enabled: - putLogsearchEnvProperty('logsearch_external_solr_kerberos_enabled', 'false') - putLogsearchEnvAttribute('logsearch_external_solr_kerberos_enabled', 'visible', 'false') + putLogsearchCommonEnvProperty('logsearch_external_solr_kerberos_enabled', 'false') + putLogsearchCommonEnvAttribute('logsearch_external_solr_kerberos_enabled', 'visible', 'false') putLogsearchEnvAttribute('logsearch_external_solr_kerberos_keytab', 'visible', 'false') putLogsearchEnvAttribute('logsearch_external_solr_kerberos_principal', 'visible', 'false') putLogfeederEnvAttribute('logfeeder_external_solr_kerberos_keytab', 'visible', 'false') http://git-wip-us.apache.org/repos/asf/ambari/blob/5c3d7dbc/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py index 6317376..378522e 100644 --- a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py +++ b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py @@ -1968,9 +1968,9 @@ class TestHDP23StackAdvisor(TestCase): expected = { 'logfeeder-env': {'property_attributes': {'logfeeder_external_solr_kerberos_keytab': {'visible': 'false'}, 'logfeeder_external_solr_kerberos_principal': {'visible': 'false'}}}, - 'logsearch-env': {'properties': {'logsearch_external_solr_kerberos_enabled': 'false'}, - 'property_attributes': {'logsearch_external_solr_kerberos_enabled': {'visible': 'false'}, - 'logsearch_external_solr_kerberos_keytab': {'visible': 'false'}, + 'logsearch-common-env': {'properties': {'logsearch_external_solr_kerberos_enabled': 'false'}, + 'property_attributes': {'logsearch_external_solr_kerberos_enabled': {'visible': 'false'}}}, + 'logsearch-env': {'property_attributes': {'logsearch_external_solr_kerberos_keytab': {'visible': 'false'}, 'logsearch_external_solr_kerberos_principal': {'visible': 'false'}}}, 'logsearch-properties': { 'properties': {
