我试图弄清楚为什么即使SHOW SLAVE STATUS
没有报告任何错误,也没有任何复制(见下文):
两个节点都在运行:
mysql> SELECT VERSION();
+------------+
| VERSION() |
+------------+
| 5.1.73-log |
+------------+
1 row in set (0.00 sec)
mysql>
上
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)
#
掌握:
mysql> SHOW MASTER STATUS\G;
*************************** 1. row ***************************
File: mysql-bin.000107
Position: 228679653
Binlog_Do_DB:
Binlog_Ignore_DB:
1 row in set (0.00 sec)
ERROR:
No query specified
mysql>
奴隶:
mysql> SHOW SLAVE STATUS\G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: MASTER_HOST
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000107
Read_Master_Log_Pos: 228681259
Relay_Log_File: mysql:PR_DB-relay-bin.000150
Relay_Log_Pos: 228398599
Relay_Master_Log_File: mysql-bin.000107
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB: DB1,DB2,DB3,DB4
Replicate_Ignore_DB: information_schema,mysql
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: 228681259
Relay_Log_Space: 228681667
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:
1 row in set (0.00 sec)
ERROR:
No query specified
mysql>
掌握:
mysql> SELECT COUNT(*) FROM DB3.users;
+----------+
| COUNT(*) |
+----------+
| 97786 |
+----------+
1 row in set (0.03 sec)
mysql>
奴隶:
mysql> SELECT COUNT(*) FROM DB3.users;
+----------+
| COUNT(*) |
+----------+
| 95678 |
+----------+
1 row in set (0.01 sec)
mysql>
在设置复制的初始时间,SELECT COUNT(*)
返回相同的值。
由于:
MySQL :: MySQL 5.1 参考手册 :: 16.1.3.3 Replication Slave 选项和变量
my.cnf
的语法错误:--replicate-do-db=DB1,DB2,DB3,DB4
已替换为正确的语法: