!334 修复带cm扩容失败的问题

Merge pull request !334 from 薛蒙恩/cmexpa
This commit is contained in:
opengauss-bot
2022-09-21 12:33:17 +00:00
committed by Gitee
3 changed files with 15 additions and 9 deletions

View File

@ -199,9 +199,12 @@ class ExpansionImpl():
upgrade_sha_file = os.path.join(pkgdir,
Const.UPGRADE_SQL_SHA)
om_file = bz2_sha_file.replace(".sha256", "-om.tar.gz")
cm_file = []
if self.context.check_cm_component():
cm_file = [bz2_sha_file.replace(".sha256", "-cm.tar.gz")]
return [om_file, bz2_file, bz2_sha_file, upgrade_sql_file,
upgrade_sha_file]
upgrade_sha_file] + cm_file
def generateAndSendXmlFile(self):
"""

View File

@ -124,7 +124,7 @@ class ExpansionImplWithCm(ExpansionImpl):
"""
self.logger.log("Start to perform perinstall on nodes: "
"{0}".format(ExpansionImplWithCm.get_node_names(self.new_nodes)))
pre_install_path = os.path.realpath(os.path.join(self.context.packagepath,
pre_install_path = os.path.realpath(os.path.join(self.remote_pkg_dir,
"script", "gs_preinstall"))
sep_env_file = "--sep-env-file={0}".format(EnvUtil.getEnv("MPPDB_ENV_SEPARATE_PATH")) \
if EnvUtil.getEnv("MPPDB_ENV_SEPARATE_PATH") else ""
@ -345,15 +345,19 @@ class ExpansionImplWithCm(ExpansionImpl):
# 1.set pgxc_node_name on old nodes
gauss_home = os.path.realpath(self.static_cluster_info.appPath)
guc_path = os.path.join(gauss_home, "bin", "gs_guc")
export_str = "export LD_LIBRARY_PATH={0}:" \
"$LD_LIBRARY_PATH".format(os.path.join(gauss_home, "lib"))
cmd = "%s;%s set -N all -I all -c " \
"\\\"%s='%s'\\\"" % (export_str, guc_path,
cmd = "source %s; %s set -N all -I all -c " \
"\\\"%s='%s'\\\"" % (self.envFile, guc_path,
"pgxc_node_name",
self._get_pgxc_node_name_for_single_inst())
su_cmd = """su - {0} -c "{1}" """.format(self.user, cmd)
self.logger.debug("Set guc parameter command: {0}".format(su_cmd))
self.guc_executor(self.ssh_tool, su_cmd, socket.gethostname())
status, output = subprocess.getstatusoutput(su_cmd)
if status == 0:
self.logger.debug("Set pgxc_node_name successfully.")
else:
self.logger.debug("Set pgxc_node_name failed. "
"result is : {0}".format(output))
raise Exception(ErrorCode.GAUSS_535["GAUSS_53507"] % su_cmd)
def _get_new_node_by_back_ip(self, back_ip):
"""

View File

@ -160,8 +160,7 @@ class PreinstallImplOLAP(PreinstallImpl):
# self.context.needFixOwnerPaths will be checked the ownet
self.context.needFixOwnerPaths.append(ownerPath)
# if clusterToolPath is not exist, then create it
# if clusterToolPath does not exist, then create it
if not os.path.exists(self.context.clusterToolPath):
FileUtil.createDirectory(self.context.clusterToolPath)
FileUtil.changeMode(DefaultValue.MAX_DIRECTORY_MODE,