Mongodb replica set priority settings, mongodb replica priority

Source: Internet
Author: User

Mongodb replica set priority settings, mongodb replica priority
When you set a mongodb replica set, the Primary node, second node, and arbitration node may have unbalanced resource configurations (CPU or memory). Therefore, some nodes must not be Primary.
We know mongodb settings:
In addition to the arbitration node, each other node has a priority. You can manually set the priority to determine who has the highest weight as primay.
In a replica set, the priority value is determined by setting the priority value. The value ranges from 0 to. A larger value indicates a higher priority.
The default value is 1, and rs. conf is not displayed;
If the value is 0, it cannot be primay.


1. Set it directly during planning. This is skipped.
2. Online node configuration:
Configuration process:
By modifying the value of priority (the default priority is 1 (0-100). The larger the value of priority is, the higher the priority is)
1) PRIMARY> config = rs. conf ()
2) PRIMARY> config. members [3]. priority = 3
3) PRIMARY> rs. reconfig (config)
Note: The members and _ IDs in the braces in step 1 members do not have a relationship, but rs. conf finds out the order of node values;

These operations must be performed on the Primary process.

Reference: http://docs.mongodb.org/manual/tutorial/force-member-to-be-primary/






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.