Skip to content

Commit 9466431

Browse files
committed
Promotion part added
1 parent f495899 commit 9466431

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

articles/cosmos-db/mongodb/vcore/quickstart-cross-region-replica-portal.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ db.cats.find();
197197

198198
## Enable access to replica cluster
199199

200+
> [!IMPORTANT]
201+
> Replica clusters are always created with networking access disabled. You should add firewall rules on the replica cluster after it is created to enable read operations.
202+
200203
1. From the Azure Cosmos DB for MongoDB vCore *primary* cluster page, select the **Global distribution (preview)** page under **Settings**.
201204

202205
:::image type="content" source="media/quickstart-cross-region-replication/global-distribution-page-on-primary-cluster.png" alt-text="Screenshot of the global distribution preview page in the primary cluster properties.":::
@@ -231,15 +234,40 @@ mongosh mongodb+srv://<user>@<cluster_replica_name>.mongocluster.cosmos.azure.co
231234
```
232235
### Read data from replica cluster
233236

234-
In the MongoDB shell, read data from the database.
237+
In the MongoDB shell, read data from the database on the replica cluster.
235238

236239
```MongoDB Shell
237240
db.dogs.find();
238241
db.cats.find();
239242
```
240243

244+
## Promote replica cluster
241245

242-
246+
To promote a cluster read replica to a read-write cluster, follow these steps:
247+
248+
1. Select the *read replica cluster* in the portal.
249+
250+
1. On the cluster sidebar, under **Cluster management**, select **Global distribution (preview)**.
251+
252+
1. On the **Global distribution (preview)** page, select **Promote** on the toolbar to initiate read replica promotion to read-write cluster.
253+
254+
1. In the **Promote cluster** pop-up window, confirm that you understand how replica promotion works, and select **Promote**. Replica promotion might take a few minutes to complete.
255+
256+
### Write to promoted cluster replica
257+
258+
Once replica promotion is completed, the promote replica becomes available for writes and the former primary cluster is set to read-only.
259+
260+
Go back to the MongoDB shell session for the promoted replica and perform a write operation.
261+
262+
```MongoDB Shell
263+
db.createCollection('foxes')
264+
```
265+
266+
Go beck to the MongoDB shell session for the former primary cluster to confirm that writes are now disabled.
267+
268+
```MongoDB Shell
269+
db.createCollection('bears')
270+
```
243271

244272
## Clean up resources
245273

0 commit comments

Comments
 (0)