You can use Data-in replication to synchronize data from an external MySQL server with data in an Azure Database for MySQL flexible server. The external server can be hosted on-premises, in virtual machines, in an Azure Database for MySQL single server, or in a database service offered other cloud providers.
Data-in replication is based on the binary log (binlog) file position-based method. For more information, see Binary Log File Position Based Replication Configuration Overview.
This post provides details about how to monitor and create alerts for Data-in replication when the replication lag is high.
Before you begin to work through the process outlined in this post, be sure that you have:
The value of the Seconds_Behind_Master parameter, as displayed by the SHOW SLAVE STATUS command, is commonly used as an indication of the current replication lag of the replica. In Azure Database for MySQL - Flexible Server, the Replication Lag in Seconds metric tracks this value.
To monitor the replication lag, perform the following steps:
A graph showing the replication lag over time appears.
You can use this information to monitor the replication lag between your primary and replica servers.
If you notice that the replication lag is substantial, you can create an alert to ensure that you’re notified if the replication lag approaches a threshold that you set.
Now, when the replication lag exceeds the threshold you specified, you’ll see alerts in portal under Monitoring > Alerts
You’ll also receive an email notification at the email address you configured in action croup. When the replication lag falls below the threshold value, you’ll receive another email, as the alert will have been resolved. These emails will appear similar to the following:
It’s important to monitor the replication lag and take necessary actions if the lag exceeds the threshold to ensure your replica is in close sync with your primary. The replication lag impacting replica servers depends on several factors, including but not limited to:
Monitoring and taking timely action to reduce the replication lag is necessary to ensure that the applications that are connected to a read replica server do not get inconsistent data.
Note: To troubleshoot and resolve replication lag issues, see the following resources:
If you have any feedback or questions, please leave a comment below or email us at AskAzureDBforMySQL@service.microsoft.com.
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.