ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [1/2] ambari git commit: AMBARI-12232. upgradeHelper for a 2.1 -> 2.2 upgrade leaves Resource Manager unusable (aonishuk)
Date Wed, 01 Jul 2015 09:18:29 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 f6215227f -> 35947a6b0
  refs/heads/trunk db1425a90 -> 18443a0c6


AMBARI-12232. upgradeHelper for a 2.1 -> 2.2 upgrade leaves Resource Manager unusable (aonishuk)


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

Branch: refs/heads/trunk
Commit: 18443a0c6acbce73cf411b13d75678674949a9be
Parents: db1425a
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Wed Jul 1 12:18:21 2015 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Wed Jul 1 12:18:21 2015 +0300

----------------------------------------------------------------------
 ambari-server/src/main/python/upgradeHelper.py  | 20 +++++++++++++++-----
 .../catalog/UpgradeCatalog_2.0_to_2.2.json      |  5 ++++-
 .../catalog/UpgradeCatalog_2.1_to_2.2.json      |  5 ++++-
 3 files changed, 23 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/18443a0c/ambari-server/src/main/python/upgradeHelper.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/upgradeHelper.py b/ambari-server/src/main/python/upgradeHelper.py
index 196dd3c..a14b3ef 100644
--- a/ambari-server/src/main/python/upgradeHelper.py
+++ b/ambari-server/src/main/python/upgradeHelper.py
@@ -182,12 +182,16 @@ class Options(Const):
   REPLACE_JH_HOST_NAME_TAG = "REPLACE_JH_HOST"
   REPLACE_RM_HOST_NAME_TAG = "REPLACE_RM_HOST"
   REPLACE_WITH_TAG = "REPLACE_WITH_"
+  ZK_OPTIONS = "zoo.cfg"
+  ZK_CLIENTPORT = "clientPort"
   DELETE_OLD_TAG = "DELETE_OLD"
 
   ZOOKEEPER_SERVER = "ZOOKEEPER_SERVER"
 
   MR_MAPPING = None
   logger = None
+  server_config_factory = None
+  """:type : ServerConfigFactory"""
 
   # Api constants
   ROOT_URL = None
@@ -953,6 +957,11 @@ def get_zookeeper_quorum():
   zoo_cfg = curl(Options.COMPONENTS_FORMAT.format(Options.ZOOKEEPER_SERVER), validate=False,
simulate=False, parse=True)
   zoo_quorum = []
   zoo_def_port = "2181"
+  if Options.server_config_factory is not None and Options.ZK_OPTIONS in Options.server_config_factory.items():
+    props = Options.server_config_factory.get_config(Options.ZK_OPTIONS)
+    if Options.ZK_CLIENTPORT in props.properties:
+      zoo_def_port = props.properties[Options.ZK_CLIENTPORT]
+
   if "host_components" in zoo_cfg:
     for item in zoo_cfg["host_components"]:
       zoo_quorum.append("%s:%s" % (item["HostRoles"]["host_name"], zoo_def_port))
@@ -1028,7 +1037,8 @@ def modify_configs():
                                      Options.OPTIONS.to_stack)  # get desired version of
catalog
 
   # load all desired configs from the server
-  server_config_factory = ServerConfigFactory()
+  # ToDo: implement singleton for that class
+  Options.server_config_factory = ServerConfigFactory()
 
   if catalog is None:
     raise FatalException(1, "Upgrade catalog for version %s-%s not found, no configs was
modified"
@@ -1041,15 +1051,15 @@ def modify_configs():
     raise FatalException("Config type %s not exists, no configs was modified" % config_type)
 
   if config_type is not None:
-    modify_config_item(config_type, catalog, server_config_factory)
+    modify_config_item(config_type, catalog, Options.server_config_factory)
   else:
     for collection_name in catalog.items:
-      modify_config_item(collection_name, catalog, server_config_factory)
+      modify_config_item(collection_name, catalog, Options.server_config_factory)
 
-  server_config_factory.process_mapping_transformations(catalog)
+  Options.server_config_factory.process_mapping_transformations(catalog)
 
   # commit changes to server, if any will be found
-  server_config_factory.commit()
+  Options.server_config_factory.commit()
 
 
 def backup_configs(conf_type=None):

http://git-wip-us.apache.org/repos/asf/ambari/blob/18443a0c/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.0_to_2.2.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.0_to_2.2.json
b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.0_to_2.2.json
index 7342a35..7ecbcfd 100644
--- a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.0_to_2.2.json
+++ b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.0_to_2.2.json
@@ -114,7 +114,10 @@
           "yarn.resourcemanager.work-preserving-recovery.enabled": "false",
           "yarn.resourcemanager.work-preserving-recovery.scheduling-wait-ms": "10000",
           "yarn.resourcemanager.zk-acl": "world:anyone:rwcda",
-          "yarn.resourcemanager.zk-address": "localhost:2181",
+          "yarn.resourcemanager.zk-address": {
+            "value": "{ZOOKEEPER_QUORUM}",
+            "template": "yes"
+          },
           "yarn.resourcemanager.zk-num-retries": "1000",
           "yarn.resourcemanager.zk-retry-interval-ms": "1000",
           "yarn.resourcemanager.zk-state-store.parent-path": "/rmstore",

http://git-wip-us.apache.org/repos/asf/ambari/blob/18443a0c/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.2.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.2.json
b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.2.json
index 94d30f5..613aa6f 100644
--- a/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.2.json
+++ b/ambari-server/src/main/resources/upgrade/catalog/UpgradeCatalog_2.1_to_2.2.json
@@ -269,7 +269,10 @@
           "yarn.resourcemanager.work-preserving-recovery.enabled": "false",
           "yarn.resourcemanager.work-preserving-recovery.scheduling-wait-ms": "10000",
           "yarn.resourcemanager.zk-acl": "world:anyone:rwcda",
-          "yarn.resourcemanager.zk-address": "localhost:2181",
+          "yarn.resourcemanager.zk-address": {
+            "value": "{ZOOKEEPER_QUORUM}",
+            "template": "yes"
+          },
           "yarn.resourcemanager.zk-num-retries": "1000",
           "yarn.resourcemanager.zk-retry-interval-ms": "1000",
           "yarn.resourcemanager.zk-state-store.parent-path": "/rmstore",


Mime
View raw message