ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alejan...@apache.org
Subject ambari git commit: AMBARI-13723. Express Upgrade: HDP 2.1->2.3 must uninstall 2.1 bits before starting on 2.3 (alejandro)
Date Wed, 04 Nov 2015 23:27:29 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 943323fc6 -> 67e069ef3


AMBARI-13723. Express Upgrade: HDP 2.1->2.3 must uninstall 2.1 bits before starting on
2.3 (alejandro)


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

Branch: refs/heads/trunk
Commit: 67e069ef37400221ced55356f215ab591f8798ea
Parents: 943323f
Author: Alejandro Fernandez <afernandez@hortonworks.com>
Authored: Wed Nov 4 13:48:25 2015 -0800
Committer: Alejandro Fernandez <afernandez@hortonworks.com>
Committed: Wed Nov 4 15:27:03 2015 -0800

----------------------------------------------------------------------
 .../custom_actions/scripts/remove_bits.py       | 55 ++++++++++++++++++++
 .../HDP/2.1/upgrades/nonrolling-upgrade-2.3.xml | 23 +++++++-
 2 files changed, 77 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/67e069ef/ambari-server/src/main/resources/custom_actions/scripts/remove_bits.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/custom_actions/scripts/remove_bits.py b/ambari-server/src/main/resources/custom_actions/scripts/remove_bits.py
new file mode 100644
index 0000000..e69a2e4
--- /dev/null
+++ b/ambari-server/src/main/resources/custom_actions/scripts/remove_bits.py
@@ -0,0 +1,55 @@
+#!/usr/bin/env python
+"""
+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.
+
+Ambari Agent
+
+"""
+
+from resource_management.libraries.script import Script
+from resource_management.libraries.functions.constants import Direction
+from resource_management.libraries.functions.default import default
+from resource_management.core.exceptions import Fail
+from resource_management.core.logger import Logger
+from resource_management.core.resources.packaging import Package
+
+
+class RemoveBits(Script):
+  """
+  This script is called during Express Upgrade to remove bits.
+  """
+
+  def remove_hdp_21(self, env):
+    """
+    During Express Upgrade from HDP 2.1 to any higher version (HDP 2.2 or 2.3), the HDP 2.1
bits must be uninstalled.
+    This is because /usr/bin/hadoop used to be a shell script in HDP 2.1, but in HDP 2.3
it is
+    a symlink to /usr/hdp/current/hadoop-client/bin/hadoop
+    so both versions cannot coexist.
+    """
+    Logger.info("Attempting to remove bits for HDP 2.1")
+    config = Script.get_config()
+
+    packages_to_remove = ["zookeeper", "hadoop", "hadoop-lzo", "hadoop-hdfs", "hadoop-libhdfs",
"hadoop-yarn", "hadoop-client", "hadoop-mapreduce", "hive", "hive-hcatalog", "hive-jdbc",
"hive-webhcat", "hcatalog", "webhcat-tar-hive", "webhcat-tar-pig", "oozie", "oozie-client",
"pig", "sqoop", "tez" "falcon", "storm", "flume", "hbase", "phoenix"]
+    packages_to_remove.reverse()
+    Logger.info("Packages to remove: {0}".format(" ".join(packages_to_remove)))
+
+    for name in packages_to_remove:
+      Logger.info("Attempting to remove {0}".format(name))
+      Package(name, action="remove")
+
+if __name__ == "__main__":
+  RemoveBits().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/67e069ef/ambari-server/src/main/resources/stacks/HDP/2.1/upgrades/nonrolling-upgrade-2.3.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1/upgrades/nonrolling-upgrade-2.3.xml
b/ambari-server/src/main/resources/stacks/HDP/2.1/upgrades/nonrolling-upgrade-2.3.xml
index 91d4f64..cacaf8d 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1/upgrades/nonrolling-upgrade-2.3.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1/upgrades/nonrolling-upgrade-2.3.xml
@@ -184,6 +184,27 @@
       </execute-stage>
     </group>
 
+    <!--
+    This is the point of no return since will delete HDP 2.1 bits.
+    -->
+    <group xsi:type="cluster" name="REMOVE_HDP_21" title="Remove HDP 2.1">
+      <direction>UPGRADE</direction>
+      <skippable>false</skippable>
+
+      <execute-stage title="Confirm removing HDP 2.1">
+        <task xsi:type="manual">
+          <message>Please confirm you want to proceed, which will delete HDP 2.1. This
is because HDP 2.1 did not use versioned packages and cannot coexist with HDP 2.3</message>
+        </task>
+      </execute-stage>
+
+      <execute-stage title="Remove HDP 2.1">
+        <task xsi:type="execute">
+          <script>scripts/remove_bits.py</script>
+          <function>remove_hdp_21</function>
+        </task>
+      </execute-stage>
+    </group>
+
     <!-- After processing this group, will change the effective Stack of the UpgradeContext
object. -->
     <group xsi:type="update-stack" name="UPDATE_DESIRED_STACK_ID" title="Update Target
Stack">
       <execute-stage title="Update Target Stack" service="" component="">
@@ -301,8 +322,8 @@
       <execute-stage service="STORM" component="NIMBUS" title="Apply config changes for
Nimbus">
         <task xsi:type="configure" id="hdp_2_3_0_0_nimbus_update_env_vars"/>
       </execute-stage>
-
     </group>
+
     <!-- Now, restart all of the services. -->
     <group xsi:type="restart" name="ZOOKEEPER" title="ZooKeeper">
       <service-check>false</service-check>


Mime
View raw message