MongoDB replica Set Maintenance main work:
1. View replica set status (cluster status, synchronization delay, single library run status Mongostate)
2, delete nodes, stop node shutdown
MongoDB replica set cluster synchronization mechanism
The purpose of data replication is to maximize the availability of data, redundancy, and avoid single points of failure.
Only one server can be written at the same time in a replica set, primary the main library, synchronizing data from the library
Replica set master-slave replication is also the process of asynchronous synchronization. Slave gets the log from the primary and then performs the logged operation in full sequence on its own (the log does not log query operations, only records update operations). The synchronized log is the Oplog.rs table in the local library, which occupies a larger space and has a disk size of 5%. Startup parameter settings oplog.rs size:--oplogsize 1000, Unit m. In the production environment, it is recommended that the settings be larger to prevent the synchronization situation from occurring.
View cluster status
Rs.status ()
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/8C/11/wKiom1hg1xiBP7bjAADBMNj_mvU878.png "title=" Rsstats.png "alt=" Wkiom1hg1xibp7bjaadbmnj_mvu878.png "/>
2.db.printslavereplicationinfo ()
650) this.width=650; "src=" Http://pic002.cnblogs.com/images/2012/184465/2012072515021832.png "/>
3.mongostat
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/8C/11/wKiom1hg1pXTgeHtAACXCt8ELss730.png "title=" Mongostat.png "alt=" Wkiom1hg1pxtgehtaacxct8elss730.png "/>
MongoDB Replica Set Maintenance