Skip to content

Commit 58a4300

Browse files
committed
Promo part improvements and other fixes
1 parent f4071e2 commit 58a4300

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

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

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ mongosh mongodb+srv://<user>@<primary_cluster_name>.mongocluster.cosmos.azure.co
137137

138138
### Ingest data
139139

140-
Create a *my_script.js* script file to run from the MongoDB shell.
140+
Create a *my_script.js* script file to run it from the MongoDB shell.
141141

142142
```JavaScript
143143
let dogDocs = [
@@ -181,14 +181,15 @@ Create a *my_script.js* script file to run from the MongoDB shell.
181181
```
182182

183183
This script file creates two collections and inserts documents with data into those collections.
184+
Save my_script.js file in a folder accessible to the MongoDB shell session.
184185

185-
Run the script from the MongoDB shell.
186+
Run the script from the MongoDB shell connected to the primary MongoDB cluster.
186187

187188
```MongoDB Shell
188189
load(my_script.js);
189190
```
190191

191-
In the MongoDB shell, read data from the database.
192+
In the MongoDB shell connected to the primary MongoDB cluster, read data from the database.
192193

193194
```MongoDB Shell
194195
db.dogs.find();
@@ -204,7 +205,7 @@ db.cats.find();
204205

205206
:::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.":::
206207

207-
1. Select *cluster replica name* to open the read cluster replica properties in the Azure portal.
208+
1. Select *cluster replica name* in the **Read replica** field to open the read cluster replica properties in the Azure portal.
208209

209210
1. On the MongoDB vCore replica cluster page, under **Settings**, select **Networking**.
210211

@@ -225,16 +226,17 @@ Get the connection string for the read cluster replica in another region.
225226
1. Copy the value from the **Connection string** field.
226227

227228
> [!IMPORTANT]
228-
> The connection string of the read replica cluster in the portal contains unique replica cluster name that you selected during replica creation. The username and password values for the read replica cluster are always the same as the ones on its primary cluster.
229+
> The connection string of the read replica cluster contains unique *replica cluster name* that you selected during replica creation. The username and password values for the read replica cluster are always the same as the ones on its primary cluster.
229230
230231
1. In command line, use the MongDB shell to connect to the read replica cluster using its connection string.
231232

232233
```cmd
233234
mongosh mongodb+srv://<user>@<cluster_replica_name>.mongocluster.cosmos.azure.com/?tls=true&authMechanism=SCRAM-SHA-256&retrywrites=false&maxIdleTimeMS=120000
234235
```
236+
235237
### Read data from replica cluster
236238

237-
In the MongoDB shell, read data from the database on the replica cluster.
239+
In the MongoDB shell connected to the replica cluster, read data from the database.
238240

239241
```MongoDB Shell
240242
db.dogs.find();
@@ -261,13 +263,25 @@ To promote a cluster read replica to a read-write cluster, follow these steps:
261263

262264
Once replica promotion is completed, the promoted replica becomes available for writes and the former primary cluster is set to read-only.
263265

264-
Go back to the MongoDB shell session for the promoted replica and perform a write operation.
266+
Use the MongDB shell in command line to connect to *the promoted replica cluster* using its connection string.
267+
268+
```cmd
269+
mongosh mongodb+srv://<user>@<promoted_replica_cluster_name>.mongocluster.cosmos.azure.com/?tls=true&authMechanism=SCRAM-SHA-256&retrywrites=false&maxIdleTimeMS=120000
270+
```
271+
272+
In the MongoDB shell session, perform a write operation.
265273

266274
```MongoDB Shell
267275
db.createCollection('foxes')
268276
```
269277

270-
Go back to the MongoDB shell session for the former primary cluster to confirm that writes are now disabled.
278+
Use the MongDB shell in command line to connect to *the new replica cluster* (former primary cluster) using its connection string.
279+
280+
```cmd
281+
mongosh mongodb+srv://<user>@<new_replica_cluster_name>.mongocluster.cosmos.azure.com/?tls=true&authMechanism=SCRAM-SHA-256&retrywrites=false&maxIdleTimeMS=120000
282+
```
283+
284+
In the MongoDB shell, confirm that writes are now disabled on the new replica (former primary cluster).
271285

272286
```MongoDB Shell
273287
db.createCollection('bears')

0 commit comments

Comments
 (0)