Node Role | Description | Remarks |
Primary node | The primary node handles all data read and write requests. | Each replica set instance can have only one primary node. |
Secondary node | Secondary nodes replicate data from the primary node by periodically polling its oplog (operation log) to maintain data consistency. If the primary node fails, an automatic election promotes a secondary node to primary, ensuring high availability. | When a client connects to a secondary node, it can only read data, not write data. You can add more secondary nodes as needed. For details, see Add Secondary Node. A secondary node can be promoted to a primary node. For specific operations, see Promote Secondary Node to Primary Node. |
Hidden node | By default, one of the secondary nodes in each newly created instance is designated as the hidden node, serving as a hidden member that backs up data. When a secondary node fails, the hidden node can be promoted to replace the failed secondary node, ensuring high availability. | A replica set instance can have only one hidden node. A secondary node that has been configured as the hidden node cannot be deleted. A hidden node has its priority set to 0, making it ineligible for election as the primary. However, it still participates in the election voting process. |
Read-only node | When you enable the read-only routing feature, the system designates one or more secondary nodes as read-only nodes. Read-only nodes are primarily designed for scenarios with massive read requests. They synchronize data from the primary node or secondary nodes through the oplog (operation log). The system automatically routes read requests to read-only nodes to reduce the load on the primary node. | A read-only node does not participate in primary election and cannot be elected as the primary node. A replica set instance can have multiple read-only nodes. For details, see Add Read-Only Node. |
フィードバック