我已经在两个不同的服务器中设置了一个主/从复制,具有完全相同的charachterisits。MySQL版本为5.5,从从VPN连接连接到主。
我很困惑replicatino正在工作,当我在主上创建一个新数据库时,我可以看到该数据库存在于从属中。问题是当我执行一些故障场景并关闭VPN时,主上的复制蛋白状态没有显示任何错误:
mysql> show slave status;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 10.0.0.2
Master_User: replication
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000001
Read_Master_Log_Pos: 52360
Relay_Log_File: mysql-relay-log.000004
Relay_Log_Pos: 441
Relay_Master_Log_File: mysql-bin.000001
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 52360
Relay_Log_Space: 597
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1
"""
我知道是否slave_io_running和slave_sql_running是是的,这表明复制正在起作用,但是这是不可能的,因为服务器之间没有网络连接。
如果我重新启动了从属的MySQL,那么我会看到一个连接错误,并且复制状态将是准确的,如果我可以重新启用VPN而不重新启动从属上的MySQL,则如果我创建如果我创建复制,则复制似乎会继续正常工作。一个新的数据库。
一些人可以帮助吗?
也许您应该看一下此复制选项http://dev.mysql.com/doc/refman/5.5/en/replication-replication-eplication-eptions-options-slave.html#option_mysqld_slave-net-Timeout