Skip to content

Latest commit

 

History

History
49 lines (43 loc) · 1.18 KB

README.md

File metadata and controls

49 lines (43 loc) · 1.18 KB

Setup shards

This will provision the following infrastructure

  • config server A replica set will be created with 2 secondary and 1 primary node.
    It will run on the following ports
    • 30001
    • 30002
    • 30003
  • shard server 1 A replica set will be created with 2 secondary and 1 primary node.
    It will run on the following ports
    • 50001
    • 50002
    • 50003
  • shard server 2 A replica set will be created with 2 secondary and 1 primary node.
    It will run on the following ports
    • 50004
    • 50005
    • 50006
  • shard server 3 A replica set will be created with 2 secondary and 1 primary node.
    It will run on the following ports
    • 50007
    • 50008
    • 50009
  • shard server 4 A replica set will be created with 2 secondary and 1 primary node.
    It will run on the following ports
    • 50010
    • 50011
    • 50012
  • mongos This is the router and will be running on port 60000

Use the following command to connect to mongos

mongosh mongodb://`ipconfig getifaddr en0`:60000

alternatively run

ip=`ipconfig getifaddr en0`
mongosh mongodb://$ip:60000