MongoDB High-availability switch

Source: Internet
Author: User
Tags mongodb
MongoDB High-availability cluster switching
  • MongoDB's simplest cluster mode is the three-node replica set (replica set), which ensures that after a node failure, the remaining nodes can continue to provide services.
  • In the MongoDB cluster, there is also the role of the primary node and the standby node, such as the main node problem, will be elected in the standby node to generate a new master node, its primary standby node automatically to the new master node synchronization.
  • After switching between the old and new master nodes, it is almost transparent to the front-end application because of the special connection string configuration of MongoDB:
mongodb://[username:[email protected]]host1[:port1][,host2[:port2],…[,hostN[:portN]]][/[database][?options]]
At last
  • In the above configuration, you can configure multiple MongoDB Host,mongodb will automatically detect the primary node in the replica set, and make connections, such as the primary node hangs, when the switchover process is not completed, the front-end application will error, until the switch is complete, the new connection will be connected to the new primary node to continue to provide services.
  • This special connection string implementation, no longer for MongoDB to build the VIP auto-switch, such as LVS, the default is to support high-availability failover.

MongoDB High-availability switch

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.