Guest User

Untitled

a guest
Jun 21st, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. ` mongod --replSet m101 --logpath "1.log" --dbpath data/rs1 --port 27017 --smallfiles --oplogSize 64 --fork`
  2. ` mongod --replSet m101 --logpath "2.log" --dbpath data/rs2 --port 27018 --smallfiles --oplogSize 64 --fork`
  3. ` mongod --replSet m101 --logpath "3.log" --dbpath data/rs3 --port 27019 --smallfiles --oplogSize 64 --fork
  4.  
  5.  
  6. // create a cli connection to first instance
  7. ` mongod --port 27017`
  8.  
  9. // in the connected cli
  10.  
  11. ```js
  12.  
  13.  
  14. config = { _id: "m101", members:[
  15. { _id : 0, host : "localhost:27017"},
  16. { _id : 1, host : "localhost:27018"},
  17. { _id : 2, host : "localhost:27019"} ]
  18. };
  19. rs.initiate(config);
  20.  
  21.  
  22. ```
Add Comment
Please, Sign In to add comment