Created
November 30, 2014 00:42
-
-
Save giobyte8/aedef191574d1f69dd6a to your computer and use it in GitHub Desktop.
After run mongodb_create_replica_set.sh we need config the replica, run this with a command like: mongo --port 27017 < mongodb_init_replica.js
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
/** | |
* We should config the replica after start the 3 servers | |
* run this with a command like: | |
* mongo --port 27017 < mongodb_init_replica.js | |
*/ | |
config = { _id: "m101", members:[ | |
{ _id : 0, host : "localhost:27017"}, | |
{ _id : 1, host : "localhost:27018"}, | |
{ _id : 2, host : "localhost:27019"} ] | |
}; | |
rs.initiate(config); | |
rs.status(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment