Skip to content

Instantly share code, notes, and snippets.

@andersao
Created February 26, 2015 20:00
Show Gist options
  • Save andersao/8e43daba281d59a003de to your computer and use it in GitHub Desktop.
Save andersao/8e43daba281d59a003de to your computer and use it in GitHub Desktop.
ReplicaSet Mongo
mkdir -p /data/mongodb/rs0-0 /data/mongodb/rs0-1 /data/mongodb/rs0-2
sudo nohup mongod --port 27017 --dbpath /data/mongodb/rs0-0 --replSet temporeal --smallfiles --oplogSize 128 > mongo-rs-0.log &
sudo nohup mongod --port 27018 --dbpath /data/mongodb/rs0-1 --replSet temporeal --smallfiles --oplogSize 128 > mongo-rs-1.log &
sudo nohup mongod --port 27019 --dbpath /data/mongodb/rs0-2 --replSet temporeal --smallfiles --oplogSize 128 > mongo-rs-2.log &
mongo --port 27017
rs.initiate({_id: "temporeal",members: [{_id: 0,host: "localhost:27017"}]});
rs.add("localhost:27018")
rs.add("localhost:27019")
NODE_ENV=development node bin/www
#http://docs.mongodb.org/manual/tutorial/deploy-replica-set-for-testing/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment