Troubleshooting guide: Cross-region replication in Azure Cosmos DB for MongoDB vCore
APPLIES TO: MongoDB vCore
This guide is designed to help you troubleshoot common issues when using cross-region replication with Azure Cosmos DB for MongoDB vCore. It offers practical solutions for connectivity problems and optimization challenges to improve your experience.
Common issues and solutions
My data doesn't seem to replicate to another region.
Ensure your vCore cluster has a cross-region replica created. A replica cluster can be created during initial cluster provisioning or added later. You can verify the existence of a replica on the 'Overview' page or create a new one on the 'Global distribution' page of your vCore cluster in the Azure portal.
I can't find connection string for replica cluster.
The replica cluster is a full replica of the primary cluster with writes disabled. It's represented as a separate vCore cluster resource in Azure and has its own connection string.
To locate the replica cluster:
- Open the properties page of the primary vCore cluster in the Azure portal.
- Navigate to the 'Global distribution' page and click on the hyperlinked name of the replica cluster.
- In the replica cluster’s properties, navigate to the 'Connection strings' page to copy the connection string.
I can't connect to replica cluster.
Ensure that public or private access is enabled for the replica cluster. When a replica cluster is created in another region, its network settings aren't automatically replicated from the primary Azure Cosmos DB for MongoDB vCore cluster.
To enable access:
- To allow public access, add firewall rules.
- Alternatively, create private endpoints to enable private access to the replica cluster.
How can I track utilization of various resources such as memory or IOPS on my replica cluster?
Since the replica cluster is a full replica of the primary Azure Cosmos DB for MongoDB vCore cluster, it has its own metrics for monitoring resource consumption.
To view metrics:
- Open the properties page of the replica cluster in the Azure portal.
- Navigate to the Metrics page to access and review the resource consumption details.
See more detailed guidance on using metrics with Azure Cosmos DB for MongoDB vCore on this page.
How can I open replica cluster in another region for writes?
You can promote the replica cluster to become a read-write cluster at any time. When you promote the replica cluster in region B, the ex-primary cluster in region A is set to read-only mode, effectively making it the replica cluster for the newly promoted primary cluster.
To promote the replica cluster:
- Open the properties page of the replica cluster in the Azure portal.
- Navigate to the Global distribution page.
- Select Promote and confirm the promotion.
During the promotion process, the global read-write connection string is updated to point to the newly promoted replica cluster once it's open for write operations.
Replica cluster isn't needed anymore. How can I disable replication and delete replica cluster?
You can delete a replica cluster at any time without impacting the primary cluster or the data stored and written to it. However, if you need to delete both the replica and primary clusters, ensure that the replica cluster is deleted first.
To delete a replica cluster:
- Open the properties page of the replica cluster in the Azure portal.
- On the Overview page, select Delete in the toolbar.
- Carefully read the warning message and confirm the deletion.
Next steps
- If you followed all the troubleshooting steps and still can't resolve your issue, you can open a support request for further assistance.
- If you're troubleshooting common issues with Azure Cosmos DB for MongoDB vCore, see this troubleshooting guide.