diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/slave_recover_switch.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/slave_recover_switch.py index 3c082d7920..eadb3ef073 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/slave_recover_switch.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/slave_recover_switch.py @@ -151,4 +151,4 @@ def slave_migrate_switch_sub_flow( ) ), ) - return sub_pipeline.build_sub_process(sub_name=_("[{}]成对切换".format(cluster.name))) + return sub_pipeline.build_sub_process(sub_name=_("{}切换到新从库{}:{}".format(cluster.name, new_slave_ip, master.port))) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_migrate_cluster_remote_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_migrate_cluster_remote_flow.py index 7a29c92f12..04bb1f82d6 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_migrate_cluster_remote_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_migrate_cluster_remote_flow.py @@ -44,14 +44,12 @@ from backend.flow.plugins.components.collections.common.pause import PauseComponent from backend.flow.plugins.components.collections.mysql.clear_machine import MySQLClearMachineComponent from backend.flow.plugins.components.collections.mysql.exec_actuator_script import ExecuteDBActuatorScriptComponent -from backend.flow.plugins.components.collections.mysql.mysql_crond_control import MysqlCrondMonitorControlComponent from backend.flow.plugins.components.collections.mysql.mysql_db_meta import MySQLDBMetaComponent from backend.flow.plugins.components.collections.mysql.trans_flies import TransFileComponent from backend.flow.utils.common_act_dataclass import DownloadBackupClientKwargs from backend.flow.utils.mysql.common.mysql_cluster_info import get_ports, get_version_and_charset from backend.flow.utils.mysql.mysql_act_dataclass import ( ClearMachineKwargs, - CrondMonitorKwargs, DBMetaOPKwargs, DownloadMediaKwargs, ExecActuatorKwargs, @@ -439,18 +437,18 @@ def migrate_cluster_flow(self, use_for_upgrade=False): db_backup_pkg_type=MysqlVersionToDBBackupForMap[self.data["db_version"]], ) ) - tendb_migrate_pipeline.add_act( - act_name=_("屏蔽监控 {} {}").format(self.data["new_master_ip"], self.data["new_slave_ip"]), - act_component_code=MysqlCrondMonitorControlComponent.code, - kwargs=asdict( - CrondMonitorKwargs( - bk_cloud_id=cluster_class.bk_cloud_id, - exec_ips=[self.data["new_master_ip"], self.data["new_slave_ip"]], - port=0, - minutes=240, - ) - ), - ) + # tendb_migrate_pipeline.add_act( + # act_name=_("屏蔽监控 {} {}").format(self.data["new_master_ip"], self.data["new_slave_ip"]), + # act_component_code=MysqlCrondMonitorControlComponent.code, + # kwargs=asdict( + # CrondMonitorKwargs( + # bk_cloud_id=cluster_class.bk_cloud_id, + # exec_ips=[self.data["new_master_ip"], self.data["new_slave_ip"]], + # port=0, + # minutes=240, + # ) + # ), + # ) # 人工确认切换迁移实例 tendb_migrate_pipeline.add_act(act_name=_("人工确认切换"), act_component_code=PauseComponent.code, kwargs={}) # 切换迁移实例 diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_restore_slave_remote_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_restore_slave_remote_flow.py index fcdb600b19..569900870f 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_restore_slave_remote_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_restore_slave_remote_flow.py @@ -350,18 +350,18 @@ def tendb_ha_restore_slave_flow(self): cluster_type=ClusterType.TenDBHA.value, ) ) - tendb_migrate_pipeline.add_act( - act_name=_("屏蔽监控 {}").format(self.data["new_slave_ip"]), - act_component_code=MysqlCrondMonitorControlComponent.code, - kwargs=asdict( - CrondMonitorKwargs( - bk_cloud_id=cluster_class.bk_cloud_id, - exec_ips=[self.data["new_slave_ip"]], - port=0, - minutes=240, - ) - ), - ) + # tendb_migrate_pipeline.add_act( + # act_name=_("屏蔽监控 {}").format(self.data["new_slave_ip"]), + # act_component_code=MysqlCrondMonitorControlComponent.code, + # kwargs=asdict( + # CrondMonitorKwargs( + # bk_cloud_id=cluster_class.bk_cloud_id, + # exec_ips=[self.data["new_slave_ip"]], + # port=0, + # minutes=240, + # ) + # ), + # ) if not self.add_slave_only: # 人工确认切换迁移实例 diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_crond_control.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_crond_control.py index f7ea2bc831..4b54c9e426 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_crond_control.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_crond_control.py @@ -49,7 +49,9 @@ def _execute(self, data, parent_data) -> bool: cmd_str += " enable-job" else: cmd_str += " pause-job -r {}m".format(kwargs["minutes"]) - if kwargs["port"] != 0: + if kwargs["port"] == 0: + cmd_str += " --name-match mysql-monitor-.*" + else: cmd_str += " --name-match mysql-monitor-{}-.*".format(kwargs["port"]) if kwargs["name"] != "": cmd_str += " --name {}".format(kwargs["name"])