Troubleshooting RDS for Db2 replication issues
This topic describes common RDS for Db2 replication issues and provides troubleshooting guidance for both read-only and standby replicas. In addition to reviewing the following troubleshooting information, make sure that you followed the requirements and considerations, and completed the preparation steps before creating Db2 replicas.
Replica creation failures
Replica creation can fail for several reasons:
-
Inactive databases – All databases on the source DB instance must be active before creating replicas.
For information about activating databases, see Stored procedures for databases for RDS for Db2.
-
Missing automatic backups – The source DB instance must have automatic backups enabled.
For information about enabling backups, see Enabling automatic backups for RDS for Db2 replicas.
-
Parameter group issues – Custom parameter groups are required for replicas. For BYOL licensing, the parameter group must include the IBM Site ID and IBM Customer ID.
For more information, see IBM IDs for bring your own license (BYOL) for Db2.
Monitoring Db2 replication lag
To monitor replication lag in Amazon CloudWatch, view the Amazon RDS ReplicaLag
metric.
For more information about replication lag time, see Monitoring read replication and
Amazon CloudWatch metrics for Amazon RDS. For information about
setting up CloudWatch alarms for replica lag, see Monitoring Amazon RDS metrics with Amazon CloudWatch.
For a read-only replica, if the lag time is too long, query the
MON_GET_HADR
table for the status of the replica DB instance.
For a standby replica, if the lag time is too long, query the
MON_GET_HADR
table for the status of the source DB instance. Don't
query the replica DB instance because replica DB instances don't accept user
connections.
Common causes of high replication lag include the following reasons:
-
Insufficient compute resources on the replica
-
Network connectivity issues between the source and the replica
-
High write activity on the source database
-
Storage performance limitations on the replica
If high replication lag persists, consider scaling your replica resources. For more information, see Modifying an Amazon RDS DB instance.
Db2 replication errors
Db2 replication can be in an error state for a number of reasons. Perform the following actions:
-
Monitor events and the DB instance state to make sure that the DB instance is replicating.
For more information, see Working with Amazon RDS event notification.
-
Check the diagnostic logs for the Db2 replica in the Amazon RDS console. In the logs, look for errors in HADR messages. Compare the log sequence number to the primary sequence number.
For information about accessing and interpreting Db2 diagnostic logs, see Amazon RDS for Db2 database log files. For information about Db2 HADR configuration and troubleshooting, see Working with replicas for Amazon RDS for Db2.
If replication errors persist, you might need to recreate the replica.
Connection issues
If you can't connect to your replica, review the following information about the replica modes:
-
Standby replicas – They don't accept user connections by design. Use read-only replicas for read workloads.
-
Read-only replicas – Check your security group settings, network ACLs, and parameter group configurations.
For more information, see Control traffic to your AWS resources using security groups in the Amazon VPC User Guide, Control subnet traffic with network access control lists in the Amazon VPC User Guide, and Parameter groups for Amazon RDS.
Performance issues
If replica performance is poor, review the following suggestions:
-
Ensure the replica has adequate compute and storage resources.
-
Monitor the
ReplicaLag
metric in Amazon CloudWatch. -
Consider scaling up the replica DB instance class.
For information about modifying resources or instance classes, see Modifying an Amazon RDS DB instance.
For information monitoring replication lag, see Monitoring replication lag and Amazon CloudWatch metrics for Amazon RDS. For information about setting up CloudWatch alarms for replica lag, see Monitoring Amazon RDS metrics with Amazon CloudWatch.