Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ` mongod --replSet m101 --logpath "1.log" --dbpath data/rs1 --port 27017 --smallfiles --oplogSize 64 --fork`
- ` mongod --replSet m101 --logpath "2.log" --dbpath data/rs2 --port 27018 --smallfiles --oplogSize 64 --fork`
- ` mongod --replSet m101 --logpath "3.log" --dbpath data/rs3 --port 27019 --smallfiles --oplogSize 64 --fork
- // create a cli connection to first instance
- ` mongod --port 27017`
- // in the connected cli
- ```js
- config = { _id: "m101", members:[
- { _id : 0, host : "localhost:27017"},
- { _id : 1, host : "localhost:27018"},
- { _id : 2, host : "localhost:27019"} ]
- };
- rs.initiate(config);
- ```
Add Comment
Please, Sign In to add comment