!962 拆分缩容检查备机状态与停备机流程

Merge pull request !962 from 张悦萌/rebuilld_dropnode
This commit is contained in:
opengauss_bot 2024-11-12 12:44:45 +00:00 committed by Gitee
commit 7518bc22bd
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -131,12 +131,24 @@ class DropnodeImpl():
self.commonOper.checkStandbyState(hostNameLoop, i,
sshtool_host,
self.userProfile, True)
self.commonOper.stopInstance(hostNameLoop, sshtool_host, i,
self.userProfile)
self.cleanSshToolFile(sshtool_host)
else:
self.logger.log("[gs_dropnode]Cannot connect %s." % (hostNameLoop))
def stop_del_node(self):
"""
stop the target node
"""
for host in self.context.hostMapForDel.keys():
if host not in self.context.failureHosts:
sshtool_host = SshTool([host])
for i in self.context.hostMapForDel[host]['datadir']:
self.commonOper.stopInstance(host, sshtool_host, i,
self.userProfile)
self.cleanSshToolFile(sshtool_host)
else:
self.logger.log("[gs_dropnode]Cannot connect %s." % (host))
def dropNodeOnAllHosts(self):
"""
drop the target node on the other host
@ -376,6 +388,7 @@ class DropnodeImpl():
self.checkAllStandbyState()
self.dropNodeOnAllHosts()
self.operationOnlyOnPrimary()
self.stop_del_node()
self.modifyStaticConf()
self.restartInstance()
self.logger.log("[gs_dropnode]Success to drop the target nodes.")