mysql主从配置 分别为181和182, 因业务需求181挂调后需将182ip手动更改为181 重启后再改回为182。
请问这种场景下重启主机以后同步连接还能保持吗?另外在不切换ip的情况下主从配置后
主机挂机数据写入从机重启后主机能将丢失掉的数据同步回来吗
Connecting to source 127.0.0.1 copy 3307 60 mysql-bin.000028 157 LAPTOP-4LAB86RC-relay-bin.000003 326 mysql-bin.000001 Connecting No 1008 Coordinator stopped because there were error(s) in the worker(s). The most recent failure being: Worker 1 failed executing transaction 'ANONYMOUS' at master log mysql-bin.000001, end_log_pos 346. See error log and/or performance_schema.replication_applier_status_by_worker table for more details about this failure or others, if any. 0 157 32231 None 0 No No 2003 error connecting to master 'copy@127.0.0.1:3307' - retry-time: 60 retries: 2 message: Can't connect to MySQL server on '127.0.0.1:3307' (10061) 1008 Coordinator stopped because there were error(s) in the worker(s). The most recent failure being: Worker 1 failed executing transaction 'ANONYMOUS' at master log mysql-bin.000001, end_log_pos 346. See error log and/or performance_schema.replication_applier_status_by_worker table for more details about this failure or others, if any. 0 88276352-1e8e-11ed-b23d-88a4c2ffd38b mysql.slave_master_info 0 86400 230209 09:26:20 230209 09:25:16 0 0
MySQL主从复制是通过主机与从机之间进行数据同步来实现的。
如果在主机挂起后手动更改了从机的IP地址并且重新启动了从机,那么在从机重新启动之后与主机的连接就可能会被中断。
主从同步的连接是基于IP地址的,因此,更改从机的IP地址可能导致主从连接的中断。
而在主机挂起期间写入的数据将不会在从机上进行同步,因此主机重新启动后不能将其同步回来。
为了避免数据丢失,应该在主机挂起之前进行数据备份,然后在主机重新启动后将备份的数据恢复回来。
不要乱改IP
你们可以建立个故障转移群集,给两个服务器一个公有IP,其它PC去访问这个公有IP
这个IP资源到底归谁所有由故障转移群集来控制