Created
July 12, 2013 16:10
-
-
Save wolf0403/5985622 to your computer and use it in GitHub Desktop.
MongoDB replica setup
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
# When connecting using pymongo, specify "replicaSet" | |
# This allows default port running secondary nodes. | |
pymongo.MongoClient(replicaSet='rs0', slaveOk=True) |
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
port = 27017 | |
bind_ip = 127.0.0.1 | |
dbpath = /path/to/mongo-db/rs.0 | |
logpath = /path/to/mongo-db/rs0.log | |
replSet = rs0 |
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
port = 27017 | |
bind_ip = 127.0.0.1 | |
dbpath = /path/to/mongo-db/rs.1 | |
logpath = /path/to/mongo-db/rs1.log | |
replSet = rs0 |
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
[program:mongo-rs0] | |
command=/path/to/mongo/bin/mongod -f /path/to/mongo/conf.rs0 | |
directory=/path/to/mongo | |
autorestart=true | |
autostart=true | |
[program:mongo-rs1] | |
command=/path/to/mongo/bin/mongod -f /path/to/mongo/conf.rs1 | |
directory=/path/to/mongo | |
autorestart=true | |
autostart=true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment