Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. mongod --port 27017 --dbpath data\db1 --replSet replicationSet
  2. mongod --port 27018 --dbpath data\db2 --replSet replicationSet
  3. mongod --port 27019 --dbpath data\db3 --replSet replicationSet
  4. mongod --port 27020 --dbpath data\db4 --replSet replicationSet
  5. mongod --port 27021 --dbpath data\db5 --replSet replicationSet
  6.  
  7. mongo --host="127.0.0.1:27017"
  8. cfg = rs.conf()
  9. cfg.members[0].host = "127.0.0.1:27017"
  10. rs.reconfig(cfg)
  11.  
  12. rs.add("127.0.0.1:27018")
  13. rs.add("127.0.0.1:27019")
  14. rs.add("127.0.0.1:27020")
  15. rs.add("127.0.0.1:27021")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement