... Playbook #7

Increase in DB Replication Lag

An increase in replication lag between master and slave databases can result in data inconsistency and synchronization delays, impacting application functionality, user experience and recovery objectives. The playbook assists in identifying the cause of this increase to mitigate its impact.

Check if MySQL is running
                              
systemctl status mysql
                              
                            
Check if the replica server is replicating data from the primary server
                              
ssh $REPLICA_IP "mysql -u ${USERNAME} -p${PASSWORD} -e 'SHOW SLAVE STATUS\G' | grep -E 'Slave_IO_Running|Slave_SQL_Running'"
                              
                            
Check the disk usage and available space on the replica server
                              
df -h
                              
                            
Check the MySQL error log for any relevant errors
                              
tail -n 100 /var/log/mysql/error.log
                              
                            
Check the system logs for any relevant errors
                              
tail -n 100 /var/log/syslog