Mongodbmasterslave Common commands 1. check the synchronization status of www.2cto on slave. comdb. printSlaveReplicationInfo () 2. if the master service is not restarted after a long period of time, or useadmindb. runCommand ({resync: 1}) www. mongodb. orgdisplayDOCSHalted + Replication3.Mast
Common commands for mongodb master slave 1. check the synchronization status of www.2cto.com in slave. printSlaveReplicationInfo () 2. if the master service is not restarted after a long period of time, or use admin db. runCommand ({resync: 1}) http://www.mongodb.org/display/DOCS/Halted+Replication 3. mast
Common commands for mongodb master slave
1. view the synchronization status on slave
Www.2cto.com
Db. printSlaveReplicationInfo ()
2. If the master node is not synchronized for a long time
Restart the service,
Or
> Use admin
> Db. runCommand ({resync: 1 })
Http://www.mongodb.org/display/DOCS/Halted+Replication
3. What should I do if there is a problem with the Master machine? Www.2cto.com
If the Master machine fails, we can change the Slave to the Master to provide services:
Stop mongod on Slave:
Service producer D stop
Delete the local database because slave information exists.
Cd/var/lib/mongo
Rm-rf local .*
Change slave to master in the configuration file:
Vi/etc/mongod. conf
Delete the following lines:
Slave = true
Source = 192.168.1.174
Autoresync = true
Added:
Master = true
Then start mongod:
Service Producer d start