revert "AMBARI-18213. Storm components were stopped during RU and can not be started (Dmitry Lysnichenko via ncole)" (dlisnichenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/580a3513 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/580a3513 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/580a3513 Branch: refs/heads/branch-dev-patch-upgrade Commit: 580a35139ecd4ee8c47af948d1e4717533eac8f4 Parents: 37e71db Author: Lisnichenko Dmitro <dlysniche...@hortonworks.com> Authored: Wed Sep 14 12:46:32 2016 +0300 Committer: Lisnichenko Dmitro <dlysniche...@hortonworks.com> Committed: Wed Sep 14 12:46:32 2016 +0300 ---------------------------------------------------------------------- .../StormUpgradeKerberosDescriptorConfig.java | 144 ------------------- .../HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml | 5 - .../stacks/HDP/2.3/upgrades/upgrade-2.5.xml | 3 - .../HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml | 5 - .../stacks/HDP/2.4/upgrades/upgrade-2.5.xml | 3 - 5 files changed, 160 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/580a3513/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/StormUpgradeKerberosDescriptorConfig.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/StormUpgradeKerberosDescriptorConfig.java b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/StormUpgradeKerberosDescriptorConfig.java deleted file mode 100644 index 07bdaa6..0000000 --- a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/StormUpgradeKerberosDescriptorConfig.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - 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 - <p> - http://www.apache.org/licenses/LICENSE-2.0 - <p> - 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. - */ -package org.apache.ambari.server.serveraction.upgrades; - -import java.text.MessageFormat; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentMap; - -import org.apache.ambari.server.AmbariException; -import org.apache.ambari.server.actionmanager.HostRoleStatus; -import org.apache.ambari.server.agent.CommandReport; -import org.apache.ambari.server.orm.dao.ArtifactDAO; -import org.apache.ambari.server.orm.entities.ArtifactEntity; -import org.apache.ambari.server.serveraction.AbstractServerAction; -import org.apache.ambari.server.state.kerberos.KerberosConfigurationDescriptor; -import org.apache.ambari.server.state.kerberos.KerberosDescriptor; -import org.apache.ambari.server.state.kerberos.KerberosDescriptorFactory; -import org.apache.ambari.server.state.kerberos.KerberosServiceDescriptor; - -import com.google.inject.Inject; - - -/** - * Update Kerberos Descriptor Storm properties when upgrading to Storm 1.0 - */ -public class StormUpgradeKerberosDescriptorConfig extends AbstractServerAction { - - - public static final String KERBEROS_DESCRIPTOR = "kerberos_descriptor"; - public static final String STORM = "STORM"; - public static final String NEW_PART = "org.apache"; - public static final String OLD_PART = "backtype"; - - @Inject - ArtifactDAO artifactDAO; - - protected StormUpgradeKerberosDescriptorConfig() { - } - - /** - * Lists config types and properties that may be replaced "backtype" to "org.apache" - */ - private static final HashMap<String, String[]> TARGET_PROPERTIES = new HashMap<String, String[]>() {{ - put("storm-site", new String[]{ - "nimbus.authorizer", - "storm.principal.tolocal", - "drpc.authorizer" - }); - - }}; - - /** - * Update Kerberos Descriptor Storm properties when upgrading to Storm 1.0 - * <p/> - * Finds the relevant artifact entities and iterates through them to process each independently. - */ - @Override - public CommandReport execute(ConcurrentMap<String, Object> requestSharedDataContext) - throws AmbariException, InterruptedException { - - String msg = ""; - - List<ArtifactEntity> artifactEntities = artifactDAO.findByName(KERBEROS_DESCRIPTOR); - - if (artifactEntities != null) { - for (ArtifactEntity artifactEntity : artifactEntities) { - if (artifactEntity == null) { - continue; - } - msg = updateKerberosDescriptorConfigurations(msg, artifactEntity); - } - } else { - msg = msg + MessageFormat.format("{0} not found\n", KERBEROS_DESCRIPTOR); - } - - msg = MessageFormat.format("{0}\n Successfully replace properties", msg); - return createCommandReport(0, HostRoleStatus.COMPLETED, "{}", msg, ""); - } - - private String updateKerberosDescriptorConfigurations(String msg, ArtifactEntity artifactEntity) { - Map<String, Object> data = artifactEntity.getArtifactData(); - - if (data != null) { - final KerberosDescriptor kerberosDescriptor = new KerberosDescriptorFactory().createInstance(data); - - if (kerberosDescriptor != null) { - // Get the service that needs to be updated - KerberosServiceDescriptor serviceDescriptor = kerberosDescriptor.getService(STORM); - - if (serviceDescriptor != null) { - for (String configType : TARGET_PROPERTIES.keySet()) { - // Get the configuration that needs to be updated - KerberosConfigurationDescriptor configurationDescriptor = serviceDescriptor.getConfiguration(configType); - - if (configurationDescriptor != null) { - for (String key : TARGET_PROPERTIES.get(configType)) { - // Get the configuration properties that needs to be updated - String value = configurationDescriptor.getProperty(key); - if (value != null) { - value = value.replace(OLD_PART, NEW_PART); - configurationDescriptor.putProperty(key, value); - msg = msg + MessageFormat.format("{0}={1}, \n", key, value); - } else { - msg = msg + MessageFormat.format("{0} not found in {1}\n", key, configType); - } - - artifactEntity.setArtifactData(kerberosDescriptor.toMap()); - artifactDAO.merge(artifactEntity); - } - } else { - msg = msg + MessageFormat.format("{0} not found\n", configType); - } - } - } else { - msg = msg + MessageFormat.format("{0} not found\n", STORM); - } - artifactEntity.setArtifactData(kerberosDescriptor.toMap()); - artifactDAO.merge(artifactEntity); - } else { - msg = msg + "KerberosDescriptor not created from data"; - } - } else { - msg = msg + MessageFormat.format("{0} not found\n", "artifactData"); - } - return msg; - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/580a3513/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml index c734d56..d6fa4f3 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml @@ -447,11 +447,6 @@ <execute-stage service="STORM" component="NIMBUS" title="Apply config changes for Nimbus"> <task xsi:type="configure" id="hdp_2_5_0_0_upgrade_storm_1.0"/> </execute-stage> - <execute-stage service="STORM" component="NIMBUS" title="Apply config changes for Nimbus in KerberosDescriptor"> - <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.StormUpgradeKerberosDescriptorConfig"> - <summary>Upgrade Storm Security Configs to 1.0</summary> - </task> - </execute-stage> <execute-stage service="STORM" component="NIMBUS" title="Apply config changes for Storm"> <!-- Remove Atlas configs that were incorrectly added to storm-site instead of Atlas' application.properties. --> http://git-wip-us.apache.org/repos/asf/ambari/blob/580a3513/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml index b51f7ac..cca4b14 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml @@ -1034,9 +1034,6 @@ <pre-upgrade> <task xsi:type="configure" id="hdp_2_5_0_0_remove_ranger_storm_audit_db" /> <task xsi:type="configure" id="hdp_2_5_0_0_upgrade_storm_1.0"/> - <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.StormUpgradeKerberosDescriptorConfig"> - <summary>Upgrade Storm Security Configs to 1.0</summary> - </task> <!-- Remove Atlas configs that were incorrectly added to storm-site instead of Atlas' application.properties. --> <task xsi:type="configure" id="hdp_2_5_0_0_remove_storm_atlas_configs" /> http://git-wip-us.apache.org/repos/asf/ambari/blob/580a3513/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml index 41cab73..0229719 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml @@ -387,11 +387,6 @@ <execute-stage service="STORM" component="NIMBUS" title="Apply config changes for Nimbus"> <task xsi:type="configure" id="hdp_2_5_0_0_upgrade_storm_1.0"/> </execute-stage> - <execute-stage service="STORM" component="NIMBUS" title="Apply config changes for Nimbus in KerberosDescriptor"> - <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.StormUpgradeKerberosDescriptorConfig"> - <summary>Upgrade Storm Security Configs to 1.0</summary> - </task> - </execute-stage> <execute-stage service="STORM" component="NIMBUS" title="Apply config changes for Storm"> <!-- Remove Atlas configs that were incorrectly added to storm-site instead of Atlas' application.properties. --> http://git-wip-us.apache.org/repos/asf/ambari/blob/580a3513/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml index 559e06b..921fc9c 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml @@ -988,9 +988,6 @@ <pre-upgrade> <task xsi:type="configure" id="hdp_2_5_0_0_remove_ranger_storm_audit_db" /> <task xsi:type="configure" id="hdp_2_5_0_0_upgrade_storm_1.0"/> - <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.StormUpgradeKerberosDescriptorConfig"> - <summary>Upgrade Storm Security Configs to 1.0</summary> - </task> <!-- Remove Atlas configs that were incorrectly added to storm-site instead of Atlas' application.properties. --> <task xsi:type="configure" id="hdp_2_5_0_0_remove_storm_atlas_configs" />