MongoDB Replica Set

Source: Internet
Author: User
MongoDB Replica Set

  • Earlier versions used Master-slave, a master one from and MySQL similar, but slave in this architecture is read-only, when the main library down, from the library can not automatically switch to primary
  • The Master-slave mode has now been phased out, changed to a replica set, this mode has a master (primary), and multiple Slave (secondary), read-only. Support to set weights for them, when the main outage, the most weighted from the switch-based.
  • In this architecture, you can also establish a quorum (arbiter) role, which is only responsible for adjudication, not storing data
  • In this architecture, read and write data are in the Lord, in order to achieve the purpose of load balancing needs to manually specify the target server read library

MongoDB Replica Set Build

  • Three machines: 192.168.221.10 (secondary) 192.168.221.20 (primary) 192.168.221.30 (secondary), all installed mongodb-org
  • Edit profile (remove user authentication)
    vim /etc/mongod.conf  //加上以下三行replication:oplogSizeMB: 20replSetName: apenglinuxsystemctl restart mongod.service

MongoDB Replica Set

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.