@@ -270,7 +270,7 @@ The following steps will walk you through how to start and test a load balancer.
270
270
271
271
Initiate the config server in the shell :
272
272
` ` ` shell
273
- mongosh "mongodb://localhost:27217" --exec "rs.initiate( { _id: " test" , configsvr: true, members: [ { _id: 0, host: " localhost:27217" } ] })"
273
+ mongosh "mongodb://localhost:27217" --eval "rs.initiate( { _id: ' test' , configsvr: true, members: [ { _id: 0, host: ' localhost:27217' } ] })"
274
274
` ` `
275
275
276
276
Create shard replica sets :
@@ -280,7 +280,7 @@ The following steps will walk you through how to start and test a load balancer.
280
280
281
281
Initiate replica set in the shell :
282
282
` ` ` shell
283
- mongosh "mongodb://localhost:27218" --exec "rs.initiate( { _id: " testing" , members: [ { _id: 0, host: " localhost:27218" }, { _id: 1, host: " localhost:27219" }, { _id: 2, host: " localhost:27220" }] })"
283
+ mongosh "mongodb://localhost:27218" --eval "rs.initiate( { _id: ' testing' , members: [ { _id: 0, host: ' localhost:27218' }, { _id: 1, host: ' localhost:27219' }, { _id: 2, host: ' localhost:27220' }] })"
284
284
` ` `
285
285
286
286
Create two mongoses running on ports 27017 and 27018 :
@@ -289,8 +289,8 @@ The following steps will walk you through how to start and test a load balancer.
289
289
290
290
Initiate cluster on mongos in shell :
291
291
` ` ` shell
292
- mongosh "mongodb://localhost:27017" --exec "sh.addShard(" testing/localhost:27218,localhost:27219,localhost:27220" )"
293
- mongosh "mongodb://localhost:27017" --exec "sh.enableSharding(" test" )"
292
+ mongosh "mongodb://localhost:27017" --eval "sh.addShard(' testing/localhost:27218,localhost:27219,localhost:27220' )"
293
+ mongosh "mongodb://localhost:27017" --eval "sh.enableSharding(' test' )"
294
294
` ` `
295
295
296
296
1. Create an environment variable named `MONGODB_URI` that stores the URI of the sharded cluster you just created. For example : ` export MONGODB_URI="mongodb://host1,host2/"`
0 commit comments