Aurora RDS: determine replication lag

0

Since SHOW SLAVE STATUS doesn't work: What is an API-based way to determine the current replica lag, i.e., the "seconds behind master" value? MySQL 5.7.

질문됨 2년 전1170회 조회
2개 답변
0

You can use AuroraReplicaLag, AuroraReplicaLagMaximum, and AuroraReplicaLagMinimum to determine replication lag. Setting up CloudWatch alarm is easy way to monitor Aurora replication lag, or use CloudWatch API to get metrics data. https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.AuroraMySQL.Monitoring.Metrics.html#Aurora.AuroraMySQL.Monitoring.Metrics.clusters

AWS
답변함 2년 전
  • Thank you. I should have specified the use case: determining whether an SQL INSERT has reached all replicas, i.e., this query will need to be performed frequently and with low overhead. SHOW SLAVE STATUS worked very well for that in the past. I'm afraid that CloudWatch takes too long to update to make it useful for determining synchronization.

  • Thank you for your confirmation. select Replica_lag_in_msec from mysql.ro_replica_status where Session_id != "MASTER_SESSION_ID";, and select REPLICA_LAG_IN_MILLISECONDS from information_schema.REPLICA_HOST_STATUS where SESSION_ID != "MASTER_SESSION_ID"; shows replication lag by using query. You will be able to get latest replication lag on each Readers. https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Replication.html#AuroraMySQL.Replication.Monitoring

0

I do not think that you will have an AWS API or AWS CLI call for any database command. "SHOW SLAVE STATUS" is a MySQL Command, hence you do not have a ready-to-use AWS API or AWS CLI call for this.

You would have to build a custom solution for this.

AWS
D-Rao
답변함 2년 전
  • The problem is, as you probably know, that SHOW SLAVE STATUS does not work for RDS Aurora. Do you have a suggestion for a "custom solution" for this?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠