Skip to content

Instantly share code, notes, and snippets.

@ck1125
Created March 8, 2013 16:49
Show Gist options
  • Save ck1125/5117889 to your computer and use it in GitHub Desktop.
Save ck1125/5117889 to your computer and use it in GitHub Desktop.
killall -9 mongod
killall -9 mongo
mkdir -p /usr/local/var/mongodb
mkdir -p /usr/local/var/mongodb-slave1
mkdir -p /usr/local/var/mongodb-slave2
mongod --port 27017 --master --dbpath /usr/local/var/mongodb --replSet rs0 --config mongodb.conf &
mongod --port 37017 --slave --dbpath /usr/local/var/mongodb-slave1 --replSet rs0 --config mongodb.conf &
mongod --port 47017 --dbpath /usr/local/var/mongodb-slave2 --replSet rs0 --config mongodb.conf &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment