This is an automated email from the ASF dual-hosted git repository. aonishuk pushed a commit to branch branch-3.0-perf in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/branch-3.0-perf by this push: new 3c81877 AMBARI-22982. Logsearch and Kafka broker fails to start (aonishuk) 3c81877 is described below commit 3c8187716ed6d454a1d7b4f173c5d6e047d6c99a Author: Andrew Onishuk <aonis...@hortonworks.com> AuthorDate: Wed Feb 14 12:35:58 2018 +0200 AMBARI-22982. Logsearch and Kafka broker fails to start (aonishuk) --- .../apache/ambari/server/agent/stomp/dto/ClusterConfigs.java | 2 +- .../server/controller/AmbariManagementControllerImpl.java | 9 +++++++++ .../main/java/org/apache/ambari/server/state/ConfigHelper.java | 4 ---- .../KAFKA/0.8.1/package/scripts/kafka_broker.py | 2 +- .../common-services/LOGSEARCH/0.5.0/package/scripts/params.py | 10 +++++----- ambari-server/src/test/python/stacks/2.4/configs/default.json | 5 ++++- 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/dto/ClusterConfigs.java b/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/dto/ClusterConfigs.java index 22a28f0..13c1f55 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/dto/ClusterConfigs.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/dto/ClusterConfigs.java @@ -22,7 +22,7 @@ import java.util.SortedMap; import com.fasterxml.jackson.annotation.JsonInclude; -@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonInclude(JsonInclude.Include.NON_NULL) public class ClusterConfigs { private SortedMap<String, SortedMap<String, String>> configurations; private SortedMap<String, SortedMap<String, SortedMap<String, String>>> configurationAttributes; diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java index ea29c35..1c921f2 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java @@ -275,6 +275,9 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle private static final String CLUSTER_PHASE_PROPERTY = "phase"; private static final String CLUSTER_PHASE_INITIAL_INSTALL = "INITIAL_INSTALL"; private static final String CLUSTER_PHASE_INITIAL_START = "INITIAL_START"; + private static final String AMBARI_SERVER_HOST = "ambari_server_host"; + private static final String AMBARI_SERVER_PORT = "ambari_server_port"; + private static final String AMBARI_SERVER_USE_SSL = "ambari_server_use_ssl"; private static final String BASE_LOG_DIR = "/tmp/ambari"; @@ -5806,6 +5809,12 @@ public class AmbariManagementControllerImpl implements AmbariManagementControlle clusterLevelParams.put(AGENT_STACK_RETRY_ON_UNAVAILABILITY, configs.isAgentStackRetryOnInstallEnabled()); clusterLevelParams.put(AGENT_STACK_RETRY_COUNT, configs.getAgentStackRetryOnInstallCount()); + boolean serverUseSsl = configs.getApiSSLAuthentication(); + int port = serverUseSsl ? configs.getClientSSLApiPort() : configs.getClientApiPort(); + clusterLevelParams.put(AMBARI_SERVER_HOST, StageUtils.getHostName()); + clusterLevelParams.put(AMBARI_SERVER_PORT, Integer.toString(port)); + clusterLevelParams.put(AMBARI_SERVER_USE_SSL, Boolean.toString(serverUseSsl)); + for (Map.Entry<String, String> dbConnectorName : configs.getDatabaseConnectorNames().entrySet()) { clusterLevelParams.put(dbConnectorName.getKey(), dbConnectorName.getValue()); } diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java index 2bf8670..11ae92e 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java @@ -1948,10 +1948,6 @@ public class ConfigHelper { getAndMergeHostConfigs(configurations, configTags, cl); getAndMergeHostConfigAttributes(configurationAttributes, configTags, cl); - // remove empty entries - configurations.entrySet().removeIf(e -> e.getValue().isEmpty()); - configurationAttributes.entrySet().removeIf(e -> e.getValue().isEmpty()); - SortedMap<String, SortedMap<String, String>> configurationsTreeMap = sortConfigutations(configurations); SortedMap<String, SortedMap<String, SortedMap<String, String>>> configurationAttributesTreeMap = sortConfigurationAttributes(configurationAttributes); diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/kafka_broker.py b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/kafka_broker.py index 2094a6f..e9f80fd 100644 --- a/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/kafka_broker.py +++ b/ambari-server/src/main/resources/common-services/KAFKA/0.8.1/package/scripts/kafka_broker.py @@ -75,7 +75,7 @@ class KafkaBroker(Script): env.set_params(params) self.configure(env, upgrade_type=upgrade_type) - if params.security_enabled: + if params.kerberos_security_enabled: if params.version and check_stack_feature(StackFeature.KAFKA_KERBEROS, params.version): kafka_kinit_cmd = format("{kinit_path_local} -kt {kafka_keytab_path} {kafka_jaas_principal};") Execute(kafka_kinit_cmd, user=params.kafka_user) 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 02e90c0..986ba12 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 @@ -114,7 +114,7 @@ infra_solr_role_logfeeder = default('configurations/infra-solr-security-json/inf infra_solr_role_dev = default('configurations/infra-solr-security-json/infra_solr_role_dev', 'dev') infra_solr_role_ranger_admin = default('configurations/infra-solr-security-json/infra_solr_role_ranger_admin', 'ranger_user') -_hostname_lowercase = config['hostname'].lower() +_hostname_lowercase = config['agentLevelParams']['hostname'].lower() if security_enabled: kinit_path_local = status_params.kinit_path_local logsearch_jaas_file = logsearch_server_conf + '/logsearch_jaas.conf' @@ -225,10 +225,10 @@ logsearch_admin_password = default('/configurations/logsearch-admin-json/logsear logsearch_admin_content = config['configurations']['logsearch-admin-json']['content'] # for now just pick first collector -if 'ambari_server_host' in config['clusterHostInfo']: - ambari_server_host = config['clusterHostInfo']['ambari_server_host'][0] - ambari_server_port = config['clusterHostInfo']['ambari_server_port'][0] - ambari_server_use_ssl = config['clusterHostInfo']['ambari_server_use_ssl'][0] == 'true' +if 'ambari_server_host' in config['ambariLevelParams']: + ambari_server_host = config['ambariLevelParams']['ambari_server_host'] + ambari_server_port = config['ambariLevelParams']['ambari_server_port'] + ambari_server_use_ssl = config['ambariLevelParams']['ambari_server_use_ssl'] == 'true' ambari_server_protocol = 'https' if ambari_server_use_ssl else 'http' 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 a5571f1..91af813 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 @@ -28,7 +28,10 @@ "ambari_db_rca_username": "mapred", "jdk_name": "jdk-7u45-linux-x64.tar.gz", "java_home": "/usr/jdk64/jdk1.7.0_45", - "mysql_jdbc_url": "http://c6401.ambari.apache.org/resources//mysql-connector-java.jar" + "mysql_jdbc_url": "http://c6401.ambari.apache.org/resources//mysql-connector-java.jar", + "ambari_server_host": "c6401.ambari.apache.org", + "ambari_server_port": "8080", + "ambari_server_use_ssl": "false" }, "repositoryFile": { "resolved": true, -- To stop receiving notification emails like this one, please contact aonis...@apache.org.