Eu defino mestre e escravo por livro. Eu corri o LOAD DATA FROM MASTER;
inicial no escravo que funcionou muito bem. Mas quando insiro dados no mestre, ele não está sendo copiado para o escravo. Eu já tentei reiniciar os processos mestre e escravo do mysqld e "escravo escravo / início escravo" no escravo. O que está acontecendo?
Mestre
Configuração:
server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
binlog_do_db = pchelp
binlog_ignore_db = mysql
binlog_ignore_db = test
mysql > selecione * de pchelp.test_table;
+----+---------+
| id | sometxt |
+----+---------+
| 1 | x |
| 2 | x |
| 3 | y |
| 4 | z |
| 5 | p |
| 6 | i |
+----+---------+
6 rows in set (0.00 sec)
mysql > mostrar status do mestre \ G
*************************** 1. row ***************************
File: mysql-bin.000009
Position: 106
Binlog_Do_DB: pchelp
Binlog_Ignore_DB: mysql,test
1 row in set (0.00 sec)
Escravo
Configuração:
server-id = 2
master-host = hidden.x.xx
master-user = replication
master-password = hidden
master-port = 3308
replicate_do_db = pchelp
mysql > selecione * de pchelp.test_table;
+----+---------+
| id | sometxt |
+----+---------+
| 1 | x |
| 2 | x |
| 3 | y |
| 4 | z |
| 5 | p |
| 6 | i |
+----+---------+
6 rows in set (0.00 sec)
mysql > mostre o estado do escravo \ G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: hidden.x.xx
Master_User: replication
Master_Port: 3308
Connect_Retry: 60
Master_Log_File: mysql-bin.000009
Read_Master_Log_Pos: 106
Relay_Log_File: mysqld-relay-bin.000002
Relay_Log_Pos: 251
Relay_Master_Log_File: mysql-bin.000009
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB: pchelp
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: 106
Relay_Log_Space: 407
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.01 sec)
Mestre
insert into pchelp.test_table (id,sometxt) values (7,'q');
Query OK, 1 row affected (0.00 sec)
mysql > selecione * de pchelp.test_table;
+----+---------+
| id | sometxt |
+----+---------+
| 1 | x |
| 2 | x |
| 3 | y |
| 4 | z |
| 5 | p |
| 6 | i |
| 7 | q |
+----+---------+
7 rows in set (0.01 sec)
mysql > mostrar status do mestre \ G
*************************** 1. row ***************************
File: mysql-bin.000009
Position: 106
Binlog_Do_DB: pchelp
Binlog_Ignore_DB: mysql,test
1 row in set (0.00 sec)
Escravo (após inserir no mestre)
mysql > selecione * de pchelp.test_table;
+----+---------+
| id | sometxt |
+----+---------+
| 1 | x |
| 2 | x |
| 3 | y |
| 4 | z |
| 5 | p |
| 6 | i |
+----+---------+
6 rows in set (0.01 sec)
mysql > mostre o estado do escravo \ G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: hidden.x.xx
Master_User: replication
Master_Port: 3308
Connect_Retry: 60
Master_Log_File: mysql-bin.000009
Read_Master_Log_Pos: 106
Relay_Log_File: mysqld-relay-bin.000002
Relay_Log_Pos: 251
Relay_Master_Log_File: mysql-bin.000009
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB: pchelp
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: 106
Relay_Log_Space: 407
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)
Alguém tem alguma idéia brilhante sobre o que poderia estar dando errado? A 'replicação' do usuário tem permissões completas (executadas tanto no mestre quanto no escravo);
grant replication slave on *.* to replication@'%' identified by 'hidden';
GRANT ALL PRIVILEGES ON pchelp.* TO replication;
E, novamente, o comando LOAD DATA FROM MASTER;
funcionou muito bem ... não entendi.