修复使用cm_install安装cm后没有ssl相关文件导致cms无法启动的问题

This commit is contained in:
xue_meng_en 2022-11-28 15:27:33 +08:00
parent b3bd2f1687
commit 27035cbc51
7 changed files with 8 additions and 3 deletions

0
tool/cm_tool/CMLog.py Normal file → Executable file
View File

0
tool/cm_tool/Common.py Normal file → Executable file
View File

0
tool/cm_tool/ErrorCode.py Normal file → Executable file
View File

2
tool/cm_tool/InstallImpl.py Normal file → Executable file
View File

@ -139,6 +139,7 @@ class InstallImpl:
cmd = """
cp {gaussHome}/share/config/cm_server.conf.sample {cmdir}/cm_server/cm_server.conf
sed 's#log_dir = .*#log_dir = {gaussLog}/cm/cm_server#' {cmdir}/cm_server/cm_server.conf -i
sed 's/enable_ssl.*=.*on/enable_ssl = off/g' {cmdir}/cm_server/cm_server.conf -i
""".format(gaussHome=self.gaussHome, gaussLog=self.gaussLog, cmdir=cmdir)
status, output = self.executeCmdOnHost(host, cmd)
if status != 0:
@ -153,6 +154,7 @@ class InstallImpl:
cp {gaussHome}/share/config/cm_agent.conf.sample {cmdir}/cm_agent/cm_agent.conf &&
sed 's#log_dir = .*#log_dir = {gaussLog}/cm/cm_agent#' {cmdir}/cm_agent/cm_agent.conf -i &&
sed 's#unix_socket_directory = .*#unix_socket_directory = {gaussHome}#' {cmdir}/cm_agent/cm_agent.conf -i
sed 's/enable_ssl.*=.*on/enable_ssl = off/g' {cmdir}/cm_agent/cm_agent.conf -i
""".format(gaussHome=self.gaussHome, gaussLog=self.gaussLog, cmdir=cmdir)
status, output = self.executeCmdOnHost(host, cmd)
if status != 0:

0
tool/cm_tool/__init__.py Normal file → Executable file
View File

0
tool/cm_tool/cm_install Normal file → Executable file
View File

9
tool/cm_tool/cm_uninstall Normal file → Executable file
View File

@ -214,7 +214,10 @@ General options:
return
status, output = InstallImpl.refreshDynamicFile(self.envFile)
if status != 0:
self.logger.logExit("Failed to refresh dynamic file." + output)
if "The number of master dn must equal to 1." in output:
self.logger.debug("Cann't refresh dynamic file when there is no normal primary in the current cluster.")
else:
self.logger.logExit("Failed to refresh dynamic file." + output)
def deleteData(self):
"""
@ -228,7 +231,7 @@ General options:
isLocal = False
if host == self.localhostName:
isLocal = True
cmd = "source %s; rm -rf %s $GAUSSLOG/cm" % (self.envFile, path)
cmd = "source %s; rm -rf %s $GAUSSLOG/cm $GAUSSHOME/share/sslcert/cm" % (self.envFile, path)
status, output = executeCmdOnHost(host, cmd, isLocal)
if status != 0:
errorDetail = "\nCommand: %s\nStatus: %s\nOutput: %s" % (cmd, status, output)
@ -246,7 +249,7 @@ General options:
if host == self.localhostName:
isLocal = True
cmd = "source %s; cd $GAUSSHOME/bin; rm -f om_monitor* cm_agent* cm_server* " \
"cm_ctl* *manual*start*; cd -" % self.envFile
"cm_ctl* cm_persist* *manual*start*; cd -" % self.envFile
status, output = executeCmdOnHost(host, cmd, isLocal)
if status != 0:
errorDetail = "\nCommand: %s\nStatus: %s\nOutput: %s" % (cmd, status, output)