DDS Instance Node Fault Handling Mechanism
Cluster Instance
The shard and config nodes of the cluster instance use the three-node replica set architecture. When a node is faulty, the system uses another normal node to replace the faulty node to continue providing services. In addition, the system checks and rectifies the faulty node. This process is transparent to users and may cause intermittent disconnection within 30 seconds. You are advised to enable automatic reconnection on your application.
The mongos node of a cluster instance uses the single-node architecture. When a mongos node is faulty, services on the node become unavailable. You are advised to use Connection String URI to connect to all mongos nodes instead of a single mongos node. If a mongos node becomes faulty, the client can automatically perform failover and distribute requests to normal mongos nodes. Command example:
mongo "mongodb://rwuser:xxxxxxxx@192.168.95.167:8635,192.168.92.43:8635/test?authSource=admin"
If you use Connection String URI to connect to a cluster instance that is compatible with MongoDB 3.4, you are advised to use a MongoDB client later than 4.0. Otherwise, an error is reported.
Replica Set Instance
A replica set instance consists of two nodes. When a node is faulty, the system uses the other node to continue providing services. In addition, the system checks and rectifies the faulty node. This process is transparent to users and may cause intermittent disconnection within 30 seconds. You are advised to enable automatic reconnection on your application.
You are advised to use Connection String URI to connect to the nodes. Do not directly connect to the primary node of a replica set instance. If Connection String URI is used and a node becomes faulty, the read and write operations will not be affected by the failover. Command example:
mongo "mongodb://rwuser:xxxxxxxx@192.168.168.116:8635,192.168.200.147:8635/test?authSource=admin&replicaSet=replica"
For best practices of connecting replica set instances, see Connecting to a Replica Set Instance for Read and Write Separation and High Availability.
Single-Node Instance
As the name implies, single-node instance provides only one node for users to access. When a node is faulty, the system checks and rebuilds the faulty node. In the meanwhile, services on the node become unavailable.
Single-node instances apply to scenarios such as testing, training, and non-core services. You are advised to use cluster instances or replica set instances in the production environment to ensure high service availability.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot