"MongoDB" Windows platform build MONGO database replica set (similar cluster) (ii)

Source: Internet
Author: User

In our previous blog, we focused on how to build a MongoDB replica set under the Windows platform. Detailed Blog Address:

As space is limited in the previous article did not verify the results, in this blog we mainly test:

Through the Rs.status () command we can query to each node to run normally.



First, the data synchronization test


Insert on port 28011, 28012:




View reason: Find the answer online

First of all this is normal, because secondary is not allowed to read and write, in the application of writing more than read, using the 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.




"MongoDB" Windows platform build MONGO database replica set (similar cluster) (ii)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.