Skip to content

Commit

Permalink
fix: 从库原地重建添加域名改为修改域名 #4721
Browse files Browse the repository at this point in the history
  • Loading branch information
zfrendo authored and iSecloud committed Jun 3, 2024
1 parent 66b1e05 commit 09abc65
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
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,
CreateDnsKwargs,
DBMetaOPKwargs,
DownloadMediaKwargs,
ExecActuatorKwargs,
InstanceUserCloneKwargs,
UpdateDnsRecordKwargs,
)
from backend.flow.utils.mysql.mysql_act_playload import MysqlActPayload
from backend.flow.utils.mysql.mysql_context_dataclass import ClusterInfoContext
Expand Down Expand Up @@ -516,11 +516,11 @@ def deploy_restore_local_slave_flow(self):
"act_name": _("添加从库域名{}:{}").format(target_slave.machine.ip, domain),
"act_component_code": MySQLDnsManageComponent.code,
"kwargs": asdict(
CreateDnsKwargs(
UpdateDnsRecordKwargs(
bk_cloud_id=cluster_model.bk_cloud_id,
dns_op_exec_port=master.port,
exec_ip=target_slave.machine.ip,
add_domain_name=domain,
old_instance="{}{}{}".format(target_slave.machine.ip, IP_PORT_DIVIDER, master.port),
new_instance="{}{}{}".format(target_slave.machine.ip, IP_PORT_DIVIDER, master.port),
update_domain_name=domain,
)
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
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,
CreateDnsKwargs,
DBMetaOPKwargs,
DownloadMediaKwargs,
ExecActuatorKwargs,
InstanceUserCloneKwargs,
UpdateDnsRecordKwargs,
)
from backend.flow.utils.mysql.mysql_act_playload import MysqlActPayload
from backend.flow.utils.mysql.mysql_context_dataclass import ClusterInfoContext
Expand Down Expand Up @@ -471,11 +471,11 @@ def restore_local_slave_flow(self):
"act_name": _("添加从库域名{}:{}").format(target_slave.machine.ip, domain),
"act_component_code": MySQLDnsManageComponent.code,
"kwargs": asdict(
CreateDnsKwargs(
UpdateDnsRecordKwargs(
bk_cloud_id=cluster_model.bk_cloud_id,
dns_op_exec_port=master.port,
exec_ip=target_slave.machine.ip,
add_domain_name=domain,
old_instance="{}{}{}".format(target_slave.machine.ip, IP_PORT_DIVIDER, master.port),
new_instance="{}{}{}".format(target_slave.machine.ip, IP_PORT_DIVIDER, master.port),
update_domain_name=domain,
)
),
}
Expand Down
1 change: 1 addition & 0 deletions dbm-ui/backend/flow/utils/mysql/mysql_context_dataclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class ClusterInfoContext:
show_master_status_info: dict = field(default_factory=dict)
max_open_file: dict = field(default_factory=dict)
system_info: dict = field(default_factory=dict)
time_zone_info: dict = field(default_factory=dict)

@staticmethod
def get_sync_info_var_name() -> str:
Expand Down

0 comments on commit 09abc65

Please sign in to comment.