Created
November 30, 2014 13:46
-
-
Save mberberoglu/150320595174ff7f7323 to your computer and use it in GitHub Desktop.
MongoDB Replica Set
This file contains 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
mongod -port 27001 -dbpath /var/mongodb/rep1 -replSet replicationName | |
mongod -port 27002 -dbpath /var/mongodb/rep2 -replSet replicationName | |
mongod -port 27003 -dbpath /var/mongodb/rep3 -replSet replicationName |
This file contains 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
replicationConfig={_id:"replication",members:[{_id:1,host:"localhost:27001"}, | |
{_id:2,host:"localhost:27002"},{_id:3,host:"localhost:27003"}] } | |
rs.initiate(replicationConfig) | |
rs.status() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment