Start the Mogodbserver
====================
1) mongod --replSet rs0 --port 27017 --bind_ip localhost --dbpath /srv/mongodb/rs0-0 --oplogSize 128 &
2) mongod --replSet rs0 --port 27018 --bind_ip localhost --dbpath /srv/mongodb/rs0-1 --oplogSize 128 &
3) mongod --replSet rs0 --port 27019 --bind_ip localhost --dbpath /srv/mongodb/rs0-2 --oplogSize 128 &
4) mongo --port 27017
5) rs.status()
6)
conf = {
_id: "rs0",
members:
[
{_id : 0, host : "localhost:27017"},
{_id : 1, host : "localhost:27018"},
{_id : 2, host : "localhost:27019"}
]
}
7)rs.initiate(conf)
rs.slaveOk() ==> Slave Instance
Comments
Post a Comment