Skip to content

Instantly share code, notes, and snippets.

@bingeboy
Created February 24, 2014 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bingeboy/9180556 to your computer and use it in GitHub Desktop.
Save bingeboy/9180556 to your computer and use it in GitHub Desktop.
Mongo Shard Test
# Make the following directories so the relp set can log each db
mongod --replSet m101 --logpath "1.log" --dbpath /Users/bingeboy/Dropbox/mongodbClass/nodeClassAttempt2/hw6/hw6-5/data/shard0/rs1 --port 27017 --smallfiles --oplogSize 64 --fork
mongod --replSet m101 --logpath "2.log" --dbpath /Users/bingeboy/Dropbox/mongodbClass/nodeClassAttempt2/hw6/hw6-5/data/shard0/rs2 --port 27018 --smallfiles --oplogSize 64 --fork
mongod --replSet m101 --logpath "3.log" --dbpath /Users/bingeboy/Dropbox/mongodbClass/nodeClassAttempt2/hw6/hw6-5/data/shard0/rs3 --port 27019 --smallfiles --oplogSize 64 --fork
#make a config folder at the save level as the data folder
#make 3 config files, one for each server.
config = { _id: "m101", members:[ { _id : 0, host : "localhost:27017"}, { _id : 1, host : "localhost:27018"}, { _id : 2, host : "localhost:27019"} ] };
then run
rs.initiate(config);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment