Through the Rs.status () command we can query to each node to run normally.
First, the data synchronization test
Insert on port 28011, 28012:
Because secondary is not allowed to read and write, in the application of more than read, the use of replica sets to achieve read and write separation. By specifying Slaveok at the time of connection, or by specifying the secondary in the main library, the pressure of reading is shared by the primary and only the write operation is assumed. The secondary node in the replica set is not readable by default.
See details: Http://stackoverflow.com/questions/8990158/mongdodb-replicates-and-error-err-not-master-and-slaveok-false-code
Second, fault adaptive testing
When the main library stops heartbeat at the time of Detection, 28012 elect itself as the main library, see below:
28012 the above can be inserted:
28011, it's still not plugged in.
Transferred from: http://blog.csdn.net/sxb0841901116/article/details/40684101
Windows platform build MONGO database replica set (cluster-like) (ii)