Cette page n'est pas encore disponible dans votre langue. Nous nous efforçons d'ajouter d'autres langues. Nous vous remercions de votre compréhension.
- What's New
- Function Overview
- Service Overview
-
Getting Started
- Overview
- Getting Started with Clusters
- Getting Started with Replica Sets
- Getting Started with Single Nodes
- Logging In to the DDS Console
- Example: Buying and Connecting to a DDS Instance
- Change History (Getting Started) Europe Site
-
User Guide
- Migrating Data
- Performance Tuning
- Permissions Management
- Instance Lifecycle Management
- Instance Modifications
- Data Backups
- Data Restorations
-
Parameter Template Management
- Overview
- Creating a Parameter Template
- Modifying a Parameter Template
- Viewing Parameter Change History
- Exporting a Parameter Template
- Comparing Parameter Templates
- Replicating a Parameter Template
- Resetting a Parameter Template
- Applying a Parameter Template
- Viewing Application Records of a Parameter Template
- Modifying the Description of a Parameter Template
- Deleting a Parameter Template
- Connection Management
- Database Usage
- Data Security
- Monitoring and Alarm Reporting
- Auditing
- Logs
- Task Center
- Billing
- Tags
- Quotas
- DDS Usage Suggestions
- Change History
- Developer Guide
-
Best Practices
- Overview
- Common Methods for Connecting to a DDS Instance
- How Do Replica Sets Achieve High Availability and Read/Write Splitting?
- Sharding
- How Do I Improve DDS Performance by Optimizing SQL Statements?
- How Do I Prevent the Mongos Cache Problem?
- How Do I Solve the High CPU Usage Issue?
- Creating a User and Granting the Read-Only Permission to the User
- Security White Paper
- Performance White Paper
-
API Reference
- Before You Start
- API Overview
- Calling APIs
- Getting Started
-
APIs V3.0 (Recommended)
- Querying the API Version
- Querying Database Version Information
- Querying Database Specifications
- Querying the Database Disk Type
-
DB Instance Management
- Creating a DB Instance
- Restarting a DB Instance
- Deleting a DB Instance
- Querying Instances and Details
- Scaling Up Storage Space
- Adding Nodes for a Cluster Instance
- Modifying DB Instance Specifications
- Performing a Primary/Secondary Switchover in a Replica Set Instance
- Enabling or Disabling SSL
- Modifying a DB Instance Name
- Changing an Instance Description
- Changing a Database Port
- Changing a Security Group
- Binding an EIP
- Unbinding an EIP
- Changing a Private IP Address
- Creating Shard or Config IP Addresses of a Cluster Instance
- Configuring Cross-CIDR Access for a Replica Set
- Querying AZs to Which an Instance Can Be Migrated
- Migrating a DB Instance to Another AZ
- Adding Nodes to a Replica Set Instance
- Adding a Read Replica to an Instance
- Connection Management
-
Backup and Restoration
- Creating a Manual Backup
- Deleting a Manual Backup
- Querying the Backup List
- Querying an Automated Backup Policy
- Setting an Automated Backup Policy
- Restoring Data to a New DB Instance
- Obtaining the Link for Downloading a Backup File
- Querying the Restoration Time Ranges
- Obtaining the List of Databases That Can Be Restored
- Obtaining the List of Database Collections That Can Be Restored
- Restoring Data to the Original DB Instance
- Restoring Databases and Tables to a Point in Time
- Parameter Configuration
- Log Information Queries
- Tag Management
-
Managing Databases and Users
- Creating a Database User
- Creating a Database Role
- Querying Details About Database Users
- Querying the Database Role List
- Changing the Password of a Database User
- Checking the Password for Logging In to a Database
- Querying Cluster Balancing Settings
- Enabling or Disabling Cluster Balancing
- Setting the Activity Time Window for Cluster Balancing
- Deleting a Database User
- Deleting a Database Role
- Quota Management
- Task Management
- API V3 (Unavailable Soon)
- Examples
- Permissions Policies and Supported Actions
- Appendix
- Change History (European Sites)
- SDK Reference
-
FAQs
-
Product Consulting
- What Is the Relationship Between DDS and MongoDB Community Edition?
- What Are the Differences Between DDS and GaussDB(for Mongo)?
- What Precautions Should Be Taken When Using DDS?
- What Is the Availability of DDS DB Instances?
- Will My DDS DB Instances Be Affected by Other Users' DDS DB Instances?
- Does DDS Support Multi-AZ Deployment?
- Can I Change the VPC for a Created Instance?
- Can I Change the Region for a Created Instance?
- What Is Hidden Node?
- Database Versions
-
Resource and Disk Management
- Which Items Occupy the Storage Space of DDS Instances?
- Which Types of Logs and Files Occupy DDS DB Instance Storage Space?
- Why Is the Storage Space Usage Displayed on the GUI Smaller Than the Actual Usage?
- Why Does Available Disk Space Not Increase After Data Is Deleted?
- Why Is the Resident Memory of a 4 vCPUs/8 GB Memory Replica Set Instance Only 4 GB?
- Capacity Expansion and Specification Changes
-
Database Performance
- When Will a Primary/Standby Switchover Be Triggered for a Cluster or Replica Set?
- High Storage Usage
- What Is the Time Delay for Primary/Secondary Synchronization in a Replica Set?
- How Is Data Transferred Between the Primary and Secondary Nodes of a Replica Set?
- How Do I Clear an Alarm Saying the Shard Memory Usage Exceeds 90%?
- What Can I Do If a Query Error Is Reported After Data Is Written Into the DDS Cluster?
- Database Permissions
-
Creation and Deletion
- How Do I Select Instance Specifications and Nodes?
- Why Is an Instance Not Displayed on the Console After It Is Created?
- Can I Use a Template to Create DDS DB Instances?
- Why Is Data Missing from My Database?
- Will My Backups Be Deleted If I Delete My Cloud Account?
- What Are the Differences Between Instance Deletion and Unsubscription?
-
Database Connection
- What Should I Do If I Fail to Connect to a DDS Instance?
- What Can I Do If the Number of Connections of an Instance Reaches Its Maximum?
- How Do I Query and Limit the Number of Connections?
- What Should I Do If the ECS and DDS Are Deployed in Different VPCs and They Cannot Communicate with Each Other?
- Do Applications Need to Support Automatic Reconnecting to the DDS Database?
- How Do I Create and Log In to an ECS?
- Installing a Client
- Database Usage
- Database Migration
- Database Storage
- Database Parameters
- Backup and Restoration
- Network Security
- Monitoring and Alarm
- Change History (FAQs) Europe Site
-
Product Consulting
-
Troubleshooting
- DDS Instance Node Fault Handling Mechanism
- Connection Failure Message: network error while attempting to run command 'isMaster'
- Connection Failure Messages: No route to host and connection attempt failed
- Connection Failure Message: Authentication failed
- Connection Failure Message: couldn't connect to server
- Connection Failure Message: cannot list multiple servers in URL without 'replicaSet' option
- Connection Failure Message: Timeout while receiving message
- Connection Failure Message: exception: login failed and U_STRINGPREP_PROHIBITED_ERROR
- Change History (Troubleshooting) European Sites
- Videos
Show all
Load Imbalance of Cluster Instances
It is common that load is imbalanced between shard nodes in a cluster instance. If the shard key is incorrectly selected, no chunk is preset, and the load balancing speed between shard nodes is lower than the data insertion speed, load imbalance may occur.
This section describes how to fix load imbalance.
Fault Locating
- Connect to a database from the client.
- Run the following command to check the shard information:
sh.status()
mongos> sh.status() \--- Sharding Status --- sharding version: { "_id" : 1, "minCompatibleVersion" : 5, "currentVersion" : 6, "clusterId" : ObjectId("60f9d67ad4876dd0fe01af84") } shards: { "_id" : "shard_1", "host" : "shard_1/172.16.51.249:8637,172.16.63.156:8637", "state" : 1 } { "_id" : "shard_2", "host" : "shard_2/172.16.12.98:8637,172.16.53.36:8637", "state" : 1 } active mongoses: "4.0.3" : 2 autosplit: Currently enabled: yes balancer: Currently enabled: yes Currently running: yes Collections with active migrations: test.coll started at Wed Jul 28 2021 11:40:41 GMT+0000 (UTC) Failed balancer rounds in last 5 attempts: 0 Migration Results for the last 24 hours: 300 : Success databases: { "_id" : "test", "primary" : "shard_2", "partitioned" : true, "version" : { "uuid" : UUID("d612d134-a499-4428-ab21-b53e8f866f67"), "lastMod" : 1 } } test.coll shard key: { "_id" : "hashed" } unique: false balancing: true chunks: shard_1 20 shard_2 20
- databases lists databases for which you enable enableSharding.
- test.coll is the collection namespace. test indicates the name of the database where the collection is located, and coll indicates the name of the collection for which sharding is enabled.
- shard key is the shard key of the previous collection. _id: indicates that the shard is hashed based on _id. _id: -1 indicates that the shard is sharded based on the range of _id.
- chunks indicates the distribution of shards.
- Analyze the shard information based on the query result in 2.
- If no shard information is queried, the collections are not sharded.
Run the following command to enable sharding:
mongos> sh.enableSharding("<database>") mongos> use admin mongos> db.runCommand({shardcollection:"<database>.<collection>",key:{"keyname":<value> }})
- If an improper shard key is selected, the load may be imbalanced. For example, if a large number of requests are processed on a range of shards, the load on these shards is heavier than other shards, causing load imbalance.
You can redesign the shard key, for example, changing ranged sharding to hashed sharding.
mongos> db.runCommand({shardcollection:"<database>.<collection>",key:{"keyname":<value> }})
NOTE:
- If a sharding mode is determined, it cannot be changed easily. The sharding mode must be fully considered in the design phase.
- If a large amount of data is inserted and the data volume exceeds the load capacity of a single shard, shard imbalance occurs and the storage usage of the primary shard is too high.
You can run the following command to check the network connection of the server and ceck whether the amount of data transmitted by each network adapter reaches the upper limit.
sar -n DEV 1 //1 is the interval. Average: IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil Average: lo 1926.94 1926.94 25573.92 25573.92 0.00 0.00 0.00 0.00 Average: A1-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: A1-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: NIC0 5.17 1.48 0.44 0.92 0.00 0.00 0.00 0.00 Average: NIC1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: A0-0 8173.06 92420.66 97102.22 133305.09 0.00 0.00 0.00 0.00 Average: A0-1 11431.37 9373.06 156950.45 494.40 0.00 0.00 0.00 0.00 Average: B3-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 Average: B3-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
NOTE:
- rxkB/s is the number of KBs received per second.
- txkB/s is the number of KBs sent per second.
After the check is complete, press Ctrl+Z to exit.
If the network load is too high, analyze MQL statements, optimize the roadmap, reduce bandwidth consumption, and increase specifications to expand network throughput.
- Check whether there are sharded collections that do not carry ShardKey. In this case, requests are broadcast, which increases the bandwidth consumption.
- Control the number of concurrent threads on the client to reduce the network bandwidth traffic.
- If the problem persists, increase instance specifications in a timely manner. High-specification nodes can provide higher network throughput.
- If no shard information is queried, the collections are not sharded.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.