def pre_upgrade_restart(self, env, upgrade_type=None): """ Performs the tasks that should be done before an upgrade of oozie. This includes: - backing up configurations - running hdp-select and conf-select - restoring configurations - preparing the libext directory :param env: :return: """ import params env.set_params(params) # this function should not execute if the version can't be determined or # is not at least HDP 2.2.0.0 if not params.version or compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') < 0: return Logger.info("Executing Oozie Server Stack Upgrade pre-restart") OozieUpgrade.backup_configuration() if params.version and compare_versions(format_hdp_stack_version(params.version), '2.2.0.0') >= 0: conf_select.select(params.stack_name, "oozie", params.version) hdp_select.select("oozie-server", params.version) OozieUpgrade.restore_configuration() OozieUpgrade.prepare_libext_directory()
def pre_upgrade_restart(self, env, upgrade_type=None): """ Performs the tasks that should be done before an upgrade of oozie. This includes: - backing up configurations - running <stack-selector-tool> and <conf-selector-tool> - restoring configurations - preparing the libext directory :param env: :return: """ import params env.set_params(params) # this function should not execute if the version can't be determined or # the stack does not support rolling upgrade if not (params.version and check_stack_feature( StackFeature.ROLLING_UPGRADE, params.version)): return Logger.info("Executing Oozie Server Stack Upgrade pre-restart") OozieUpgrade.backup_configuration() if params.version and check_stack_feature(StackFeature.ROLLING_UPGRADE, params.version): conf_select.select(params.stack_name, "oozie", params.version) stack_select.select("oozie-server", params.version) OozieUpgrade.restore_configuration() OozieUpgrade.prepare_libext_directory()
def pre_upgrade_restart(self, env, upgrade_type=None): """ Performs the tasks that should be done before an upgrade of oozie. This includes: - backing up configurations - running hdp-select and conf-select - restoring configurations - preparing the libext directory :param env: :return: """ import params env.set_params(params) # this function should not execute if the version can't be determined or # is not at least HDP 2.2.0.0 if not params.version or compare_versions(format_stack_version(params.version), '2.2.0.0') < 0: return Logger.info("Executing Oozie Server Stack Upgrade pre-restart") OozieUpgrade.backup_configuration() if params.version and compare_versions(format_stack_version(params.version), '2.2.0.0') >= 0: conf_select.select(params.stack_name, "oozie", params.version) stack_select.select("oozie-server", params.version) OozieUpgrade.restore_configuration() OozieUpgrade.prepare_libext_directory()
def pre_rolling_restart(self, env): """ Performs the tasks surrounding the Oozie startup when a rolling upgrade is in progress. This includes backing up the configuration, updating the database, preparing the WAR, and installing the sharelib in HDFS. :param env: :return: """ import params env.set_params(params) # this function should not execute if the version can't be determined or # is not at least HDP 2.2.0.0 if not params.version or compare_versions( format_hdp_stack_version(params.version), '2.2.0.0') < 0: return Logger.info("Executing Oozie Server Rolling Upgrade pre-restart") OozieUpgrade.backup_configuration() conf_select.select(params.stack_name, "oozie", params.version) hdp_select.select("oozie-server", params.version) OozieUpgrade.restore_configuration() OozieUpgrade.prepare_libext_directory() OozieUpgrade.prepare_warfile()