fix expansion failed problems
This commit is contained in:
@ -553,12 +553,9 @@ class ExpansionClusterInfo(dbClusterInfo):
|
|||||||
self.compare_list(a_dict.get(a_key), b_dict.get(a_key))
|
self.compare_list(a_dict.get(a_key), b_dict.get(a_key))
|
||||||
self._remove_normal_msg(a_key)
|
self._remove_normal_msg(a_key)
|
||||||
elif isinstance(a_dict.get(a_key), str):
|
elif isinstance(a_dict.get(a_key), str):
|
||||||
if a_key not in IGNORE_CHECK_KEY:
|
pass
|
||||||
self.compare_string(a_dict.get(a_key), b_dict.get(a_key))
|
|
||||||
self._remove_normal_msg(a_key)
|
|
||||||
elif isinstance(a_dict.get(a_key), int):
|
elif isinstance(a_dict.get(a_key), int):
|
||||||
self.compare_int(a_dict.get(a_key), b_dict.get(a_key))
|
pass
|
||||||
self._remove_normal_msg(a_key)
|
|
||||||
else:
|
else:
|
||||||
raise Exception("Not support type. key is {0} , "
|
raise Exception("Not support type. key is {0} , "
|
||||||
"static value is {1}, XML value is {2}, "
|
"static value is {1}, XML value is {2}, "
|
||||||
|
|||||||
@ -28,7 +28,7 @@ import grp
|
|||||||
|
|
||||||
sys.path.append(sys.path[0] + "/../../")
|
sys.path.append(sys.path[0] + "/../../")
|
||||||
from gspylib.common.ErrorCode import ErrorCode
|
from gspylib.common.ErrorCode import ErrorCode
|
||||||
from gspylib.common.VersionInfo import VersionInfo
|
from domain_utils.cluster_file.version_info import VersionInfo
|
||||||
from gspylib.os.gsplatform import g_Platform, findCmdInPath
|
from gspylib.os.gsplatform import g_Platform, findCmdInPath
|
||||||
from gspylib.os.gsfile import g_file
|
from gspylib.os.gsfile import g_file
|
||||||
|
|
||||||
|
|||||||
@ -176,8 +176,8 @@ class ExpansionImpl():
|
|||||||
if not os.path.exists(file):
|
if not os.path.exists(file):
|
||||||
GaussLog.exitWithError("Package [%s] is not found." % file)
|
GaussLog.exitWithError("Package [%s] is not found." % file)
|
||||||
sshTool.scpFiles(file, srcFile, [host])
|
sshTool.scpFiles(file, srcFile, [host])
|
||||||
sshTool.executeCommand("cd %s;tar -xf %s" % (srcFile, pkgfiles[0]) ,
|
sshTool.executeCommand("cd %s;tar -xf %s" % (srcFile, pkgfiles[0]),
|
||||||
"", DefaultValue.SUCCESS, [host])
|
DefaultValue.SUCCESS, [host])
|
||||||
self.cleanSshToolFile(sshTool)
|
self.cleanSshToolFile(sshTool)
|
||||||
self.logger.log("End to send soft to each standby nodes.")
|
self.logger.log("End to send soft to each standby nodes.")
|
||||||
|
|
||||||
@ -373,7 +373,7 @@ class ExpansionImpl():
|
|||||||
self.getIncreaseAppNames(len(standbyHosts))):
|
self.getIncreaseAppNames(len(standbyHosts))):
|
||||||
if not self.expansionSuccess[newHost]:
|
if not self.expansionSuccess[newHost]:
|
||||||
continue
|
continue
|
||||||
log_path = DefaultValue.getUserLogDirWithUser(self.user)
|
log_path = ClusterDir.getUserLogDirWithUser(self.user)
|
||||||
log_dir = "%s/pg_log/dn_%d" % (log_path, appName)
|
log_dir = "%s/pg_log/dn_%d" % (log_path, appName)
|
||||||
audit_dir = "%s/pg_audit/dn_%d" % (log_path, appName)
|
audit_dir = "%s/pg_audit/dn_%d" % (log_path, appName)
|
||||||
installCmd = "source {envFile} ; gs_install -X {xmlFile}" \
|
installCmd = "source {envFile} ; gs_install -X {xmlFile}" \
|
||||||
@ -463,12 +463,12 @@ class ExpansionImpl():
|
|||||||
|
|
||||||
if not EnvUtil.getEnv("MPPDB_ENV_SEPARATE_PATH"):
|
if not EnvUtil.getEnv("MPPDB_ENV_SEPARATE_PATH"):
|
||||||
preinstallCmd = "{softPath}/script/gs_preinstall -U {user} -G {group} "\
|
preinstallCmd = "{softPath}/script/gs_preinstall -U {user} -G {group} "\
|
||||||
"-X {xmlFile} --non-interactive 2>&1".format(
|
"-X {xmlFile} --non-interactive --skip-hostname-set 2>&1".format(
|
||||||
softPath = self.context.packagepath, user = self.user,
|
softPath = self.context.packagepath, user = self.user,
|
||||||
group = self.group, xmlFile = tempXmlFile)
|
group = self.group, xmlFile = tempXmlFile)
|
||||||
else:
|
else:
|
||||||
preinstallCmd = "{softPath}/script/gs_preinstall -U {user} -G {group} " \
|
preinstallCmd = "{softPath}/script/gs_preinstall -U {user} -G {group} " \
|
||||||
"-X {xmlFile} --sep-env-file={envFile} " \
|
"-X {xmlFile} --sep-env-file={envFile} --skip-hostname-set " \
|
||||||
"--non-interactive 2>&1".format(softPath = self.context.packagepath,
|
"--non-interactive 2>&1".format(softPath = self.context.packagepath,
|
||||||
user = self.user,
|
user = self.user,
|
||||||
group = self.group,
|
group = self.group,
|
||||||
@ -935,9 +935,8 @@ gs_guc set -D {dn} -c "available_zone='{azName}'"
|
|||||||
srcFile = staticConfigPath
|
srcFile = staticConfigPath
|
||||||
if not os.path.exists(srcFile):
|
if not os.path.exists(srcFile):
|
||||||
GaussLog.exitWithError(ErrorCode.GAUSS_357["GAUSS_35710"] % srcFile)
|
GaussLog.exitWithError(ErrorCode.GAUSS_357["GAUSS_35710"] % srcFile)
|
||||||
hostSsh = SshTool([hostName])
|
|
||||||
targetFile = "%s/bin/cluster_static_config" % appPath
|
targetFile = "%s/bin/cluster_static_config" % appPath
|
||||||
hostSsh.scpFiles(srcFile, targetFile, [hostName], self.envFile)
|
|
||||||
# if dynamic config file exists on primary node, refreshconf on each host.
|
# if dynamic config file exists on primary node, refreshconf on each host.
|
||||||
# if not, remove it on standby nodes if exists.
|
# if not, remove it on standby nodes if exists.
|
||||||
dynamic_opt_cmd = ""
|
dynamic_opt_cmd = ""
|
||||||
@ -946,8 +945,18 @@ gs_guc set -D {dn} -c "available_zone='{azName}'"
|
|||||||
else:
|
else:
|
||||||
dynamic_opt_cmd = "if [ -f '%s' ];then rm %s;fi" % \
|
dynamic_opt_cmd = "if [ -f '%s' ];then rm %s;fi" % \
|
||||||
(dynamic_file, dynamic_file)
|
(dynamic_file, dynamic_file)
|
||||||
hostSsh.getSshStatusOutput(dynamic_opt_cmd, [hostName], self.envFile)
|
|
||||||
self.cleanSshToolFile(hostSsh)
|
if hostName != socket.gethostname():
|
||||||
|
hostSsh = SshTool([hostName])
|
||||||
|
hostSsh.scpFiles(srcFile, targetFile, [hostName], self.envFile)
|
||||||
|
hostSsh.getSshStatusOutput(dynamic_opt_cmd, [hostName], self.envFile)
|
||||||
|
self.cleanSshToolFile(hostSsh)
|
||||||
|
else:
|
||||||
|
scpcmd = "cp %s %s" % (srcFile, targetFile)
|
||||||
|
(status, output) = subprocess.getstatusoutput(scpcmd)
|
||||||
|
if status != 0:
|
||||||
|
GaussLog.exitWithError("Copy file faild. %s" % output)
|
||||||
|
|
||||||
self.logger.log("End to generate and send cluster static file.\n")
|
self.logger.log("End to generate and send cluster static file.\n")
|
||||||
if DefaultValue.get_cm_server_num_from_static(self.context.clusterInfo) > 0:
|
if DefaultValue.get_cm_server_num_from_static(self.context.clusterInfo) > 0:
|
||||||
self.logger.debug("Check new host state after restart.")
|
self.logger.debug("Check new host state after restart.")
|
||||||
|
|||||||
Reference in New Issue
Block a user