Repository: ambari Updated Branches: refs/heads/branch-rbac-sso 631a942a2 -> 5ffde649e
AMBARI-14293. While doing express upgrade multiple Clients and Services Failed to start (new patch) (dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d97b2745 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d97b2745 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d97b2745 Branch: refs/heads/branch-rbac-sso Commit: d97b27453e187004fa738ca494eced707baae8a9 Parents: 631a942 Author: Lisnichenko Dmitro <[email protected]> Authored: Tue Dec 15 21:22:12 2015 +0200 Committer: Yusaku Sako <[email protected]> Committed: Wed Dec 16 12:22:38 2015 -0800 ---------------------------------------------------------------------- .../libraries/functions/conf_select.py | 17 ++++++++++++----- .../custom_actions/scripts/install_packages.py | 18 ++++++++++-------- 2 files changed, 22 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/d97b2745/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py ---------------------------------------------------------------------- diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py b/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py index fd83c53..a3f64bf 100644 --- a/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py +++ b/ambari-common/src/main/python/resource_management/libraries/functions/conf_select.py @@ -459,12 +459,9 @@ def convert_conf_directories_to_symlinks(package, version, dirs, skip_existing_l only_if = format("ls -d {old_conf}/*")) - # Make /usr/hdp/[version]/[component]/conf point to the versioned config. # /usr/hdp/current/[component] is already set to to the correct version, e.g., /usr/hdp/[version]/[component] - try: - select("HDP", package, version) - except Exception, e: - Logger.warning("Could not select the directory for package {0}. Error: {1}".format(package, e)) + + link_component_conf_to_versioned_config(package, version) # Symlink /etc/[component]/conf to /etc/[component]/conf.backup try: @@ -487,3 +484,13 @@ def convert_conf_directories_to_symlinks(package, version, dirs, skip_existing_l Logger.error("Unsupported 'link_to' argument. Could not link package {0}".format(package)) except Exception, e: Logger.warning("Could not change symlink for package {0} to point to {1} directory. Error: {2}".format(package, link_to, e)) + + +def link_component_conf_to_versioned_config(package, version): + """ + Make /usr/hdp/[version]/[component]/conf point to the versioned config. + """ + try: + select("HDP", package, version) + except Exception, e: + Logger.warning("Could not select the directory for package {0}. Error: {1}".format(package, e)) http://git-wip-us.apache.org/repos/asf/ambari/blob/d97b2745/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py b/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py index a253337..d39ccbf 100644 --- a/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py +++ b/ambari-server/src/main/resources/custom_actions/scripts/install_packages.py @@ -190,15 +190,17 @@ class InstallPackages(Script): Logger.info("Configuration symlinks are not needed for {0}, only HDP-2.3+".format(stack_version)) return - # if already on HDP 2.3, then there's nothing to do in terms of linking configs - if self.current_hdp_stack_version and compare_versions(self.current_hdp_stack_version, '2.3') >= 0: - Logger.info("The current cluster stack of {0} does not require linking configurations".format(stack_version)) - return - - # link configs for all known packages for package_name, directories in conf_select.PACKAGE_DIRS.iteritems(): - conf_select.convert_conf_directories_to_symlinks(package_name, stack_version, directories, - skip_existing_links = False, link_to = "backup") + # if already on HDP 2.3, then we should skip making conf.backup folders + if self.current_hdp_stack_version and compare_versions(self.current_hdp_stack_version, '2.3') >= 0: + Logger.info("The current cluster stack of {0} does not require backing up configurations; " + "only conf-select versioned config directories will be created.".format(stack_version)) + # only link configs for all known packages + conf_select.link_component_conf_to_versioned_config(package_name, stack_version) + else: + # link configs and create conf.backup folders for all known packages + conf_select.convert_conf_directories_to_symlinks(package_name, stack_version, directories, + skip_existing_links = False, link_to = "backup") def compute_actual_version(self):
