Skip to content

Instantly share code, notes, and snippets.

@varavut
Created September 1, 2012 10:40
Show Gist options
  • Save varavut/3569306 to your computer and use it in GitHub Desktop.
Save varavut/3569306 to your computer and use it in GitHub Desktop.
mongostart
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