I created replicaDB and I've got a problem. While I was creating it, I did some steps below
Through those steps, the replicaDB has got the same data as masterDB has. However, a new record(id = 159), due to cron job, was inserted into masterDB after "UNLOCK TABLES;" and it wasn't synchronized in replicaDB. From id = 160, records are synchronized in replicaDB now.
How should I solve this problem?
masterDB:192.168.30.123
replicationDB:192.168.30.131
database:todo
replication user:repli4
masterDB's set up
[mysqld]
bind-address = 0.0.0.0
binlog_format = ROW
max_binlog_size = 128M
expire_logs_days = 7
log-error=/var/log/mysql/error.log
log-bin-trust-function-creators = true
log-bin
binlog-format = mixed
log-basename =master
server_id = 1
log_bin = /var/log/mysql/mysql-bin.log
replicationDB's set up
[mysqld]
bind-address = 0.0.0.0
binlog_format = ROW
max_binlog_size = 128M
expire_logs_days = 7
log-error=/var/log/mysql/error.log
log-bin-trust-function-creators = true
server_id = 5
slave-skip-errors = all
replicate-do-db = todo
read_only = ON
log_bin = mysql-bin
rpl_semi_sync_slave_enabled=ON
Could anyone help me, please?
It seems like your replica is still reading just fine from the slave status, just a data de-sync issue. The simplest thing to do here is to redo the backup and restore. After the restore, your replica should match with your master data and your replication setup should be unaffected.
FLUSH TABLES WITH READ LOCK;
on masterDBmysqldump -uusername -p database_name > master_backup.sql
mysql -uusername -p database_name < master_backup.sql
UNLOCK TABLES;
on masterDB