Created
July 29, 2014 02:44
-
-
Save iToto/650a485cda92372f1523 to your computer and use it in GitHub Desktop.
Bash script to create a mongo Replica Set
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
#!/bin/bash | |
# This script will start three Mongo nodes as a replica set. | |
# NB: Be sure to create the log files and give write perms to the user | |
# One | |
mongod --port 27017 --dbpath /srv/mongodb/rs0-0 --replSet rs0 --smallfiles --oplogSize 128 --fork --logpath /var/log/mongo/27017 | |
# Two | |
mongod --port 27018 --dbpath /srv/mongodb/rs0-1 --replSet rs1 --smallfiles --oplogSize 128 --fork --logpath /var/log/mongo/27018 | |
# Three | |
mongod --port 27019 --dbpath /srv/mongodb/rs0-2 --replSet rs2 --smallfiles --oplogSize 128 --fork --logpath /var/log/mongo/27019 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment