Created
November 30, 2014 00:39
-
-
Save giobyte8/545732b7b8a32aef4315 to your computer and use it in GitHub Desktop.
How to create a replica set in mongodb (Taken from M101JS Course)
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
#!/usr/bin/env bash | |
# Create directories for data | |
mkdir -p /data/rs1 /data/rs2 /data/rs3 | |
# Start 3 server processes on three diferent ports | |
mongod --replSet m101 --logpath "1.log" --dbpath /data/rs1 --port 27017 --oplogSize 64 --fork --smallfiles | |
mongod --replSet m101 --logpath "2.log" --dbpath /data/rs2 --port 27018 --oplogSize 64 --smallfiles --fork | |
mongod --replSet m101 --logpath "3.log" --dbpath /data/rs3 --port 27019 --oplogSize 64 --smallfiles --fork |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment