百度智能云

All Product Document

          Cloud Database MONGODB

          Set Master-Slave Switch of Sharded Cluster Instance

          Each Shard node of the MongoDB sharded cluster instance contains three nodes by default. When the master node fails, the high-availability system of the cloud database MongoDB will automatically trigger the master-slave switch to ensure overall availability. Also, it also supports manual triggering of the cloud database MongoDB’s master-slave switch feature in such scenarios as routine disaster recovery drills.

          Background Information

          The Shard node of the sharded cluster instance has three replicas, including Primary, Secondary and Hidden nodes, of which the Hidden node serves as a routine standby node to ensure high availability. After the master-slave switch of the MongoDB sharded cluster instance through the console or API, the system can implement the role exchange between the Primary node and the Secondary node in the Shard node.

          Descriptions:

          • The master-slave switch is only possible for the replica cluster instances and sharded cluster instances. The single-node instances do not support the master-slave switch due to architectural factors.
          • The master-slave switch of the sharded cluster instance requires that the Shard node to be switched be in a normal running state.

          Operating Steps

          1. Log in to MongoDB Management Console.
          2. In the upper left corner of the page, select the region where the instance is located.
          3. In the left navbar, click the Sharded cluster instance list.
            Find the target instance, and click Instance ID to enter the Instance details page.
          4. Find the Shard node that needs to be switched in the Shard list in the node information area, and click Master-slave switch, as shown in the following figure:

          Shard-switchHA.png

          1. In the pop-up Master-slave switch dialog box, click OK.
          2. The instance status changes to the status of Master-slave switch in progress. After the successful switch, the instance status changes to Running.
            In approx. 1 minute, the Shard node completes the master-slave switch. If other Shard nodes in the MongoDB sharded cluster instance have master-slave switching requirements, you can repeat the above steps.

          Relevant APIs

          Master-Slave Switch of Sharded Cluster Instance

          Previous
          Set Master-Slave Switch of Replica Cluster Instance
          Next
          Monitoring and Alarm