From b9ae3921678789b27fb81a0ad1866e8929f38baa Mon Sep 17 00:00:00 2001 From: z00848344 Date: Tue, 12 Nov 2024 09:08:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=86=E5=88=86=E7=BC=A9=E5=AE=B9=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E5=A4=87=E6=9C=BA=E7=8A=B6=E6=80=81=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script/impl/dropnode/DropnodeImpl.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/script/impl/dropnode/DropnodeImpl.py b/script/impl/dropnode/DropnodeImpl.py index d4d9bdf..61cd291 100644 --- a/script/impl/dropnode/DropnodeImpl.py +++ b/script/impl/dropnode/DropnodeImpl.py @@ -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.")