I've created a new mysql master and a slave. My master is also a slave of another running instance. The replication between those two works fine so I don't believe my issue is there.
I created a dump from the master with master-data=1
then sent the dump to the slave and created wrote it < file.sql
. If I run show slave status
I get back (roughly, simplified for MVCE, if more is needed please specify):
Slave_IO_State: Waiting for master to send event
Master_Host: master_ip
Master_User: replicant_user
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000003
Read_Master_Log_Pos: 120
Relay_Log_File: ip-slave_ip-relay-bin.000004
Relay_Log_Pos: 283
Relay_Master_Log_File: mysql-bin.000003
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Exec_Master_Log_Pos: 120
Relay_Log_Space: 512
Master_Server_Id: 2222
Master_UUID: f2c7d7a1-bb6c-11e8-a3b1-02e34d38ec08
Master_Info_File: /var/lib/mysql/master.info
Seconds_Behind_Master: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it
Master_Retry_Count: 86400
then If I do show master status
on the master I get back:
File: mysql-bin.000003
Position: 120
which looks correct, the position and the file match. Then if I view my users:
select userid, username from users order by userid desc limit 30;
I get 28 more records on my master and the master master (master master and master counts and values match) so the slave isn't getting new records despite the Slave_SQL_Running: Yes
.
How is this possible? I guess I did something wrong but what, where should I look?
I looked at the mysql-bin.000003
but is says:
Warning: this binlog is either in use or was not closed properly.
which makes sense it is the current file. I looked at the 00001
and 00002
to see if the queries I missed were in either of those files but I couldn't find them.
Best Answer
When running an intermediary replication that is also a master,
log-slave-updates
needs to be enabled to ensure that the upstream master, replicates to the downstream slave.