Created
September 1, 2012 10:40
-
-
Save varavut/3569306 to your computer and use it in GitHub Desktop.
mongostart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo /usr/bin/mongod --replSet foo --port 27017 -fork --quiet --dbpath /data/r0 --logpath /var/log/mongodb0.log | |
sudo /usr/bin/mongod --replSet foo --port 27018 -fork --quiet --dbpath /data/r1 --logpath /var/log/mongodb1.log | |
sudo /usr/bin/mongod --replSet foo --port 27019 -fork --quiet --dbpath /data/r2 --logpath /var/log/mongodb2.log | |
sudo mongo localhost:27017 --eval "config = {_id: 'foo', members: [{_id: 0, host: 'localhost:27017'},{_id: 1, host: 'localhost:27018'},{_id: 2, host: 'localhost:27019'}]};rs.initiate(config);" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment