- What's New
- Product Bulletin
- Service Overview
- Billing
- Getting Started
-
User Guide
- Function Overview
- Kernel Version Notes
- Permissions Management
-
Instance Management
- Instance Statuses
- Buying a DDM instance
- Splitting Read-only and Read-Write Services
- Changing Node Class
- Scaling Out a DDM Instance
- Scaling In a DDM Instance
- Restarting a DDM Instance or an Instance Node
- Deleting Pay-per-Use Instances
- Reloading Table Data
- Changing a Parameter Template
- Modifying Parameters of a DDM Instance
- Rolling Back the Version of a DDM Instance
- Upgrading the Version of a DDM Instance
- Upgrading the DDM Engine and OS
- Connection Management
- Schema Management
- Shard Configuration
- Data Nodes
-
Parameter Template Management
- Instance Parameters
- Creating a Parameter Template
- Modifying a Custom Parameter Template
- Comparing Two Parameter Templates
- Viewing Parameter Change History
- Replicating 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
- Account Management
- Backups and Restorations
-
Data Migration
- Overview
- Migration Evaluation
- Scenario 1: Migrating Data from an On-Premises MySQL Instance to DDM
- Scenario 2: Migrating Data from a Third-Party Cloud MySQL Instance to DDM
- Scenario 3: Migrating Data from an ECS-hosted MySQL Instance on Huawei Cloud to DDM
- Scenario 4: Exporting Data from a DDM Instance
- Scenario 5: Migrating Data from Heterogeneous Databases to DDM
- Scenario 6: Migrating Data from Huawei Cloud RDS for MySQL to DDM
- Session Management
- Slow Queries
- Monitoring and Alarm Reporting
- Task Center
- Tags
- Auditing
-
SQL Syntax
- Introduction
- DDL
- DML
- Online DDL
- Functions
- Unsupported Objects and Use Constraints
- Supported SQL Statements
- Global Sequence
- Database Management Syntax
- Advanced SQL Functions
- Quotas
-
API Reference
- Before You Start
- API Overview
- Calling APIs
-
APIs (Recommended)
-
DDM Instances
- Buying a DDM instance
- Querying DDM Instances
- Querying Details of a DDM Instance
- Modifying the Name of a DDM Instance
- Changing the Security Group of a DDM Instance
- Deleting a DDM Instance
- Restarting a DDM Instance
- Reloading Table Data
- Scaling Out a DDM Instance
- Scaling in a DDM instance
- Modifying the Read Policy of the Associated DB Instance
- Synchronizing Data Node Information
- Querying Nodes of a DDM Instance
- Querying Details of a DDM Instance Node
- Querying Parameters of a Specified DDM Instance
- Modifying Parameters of a DDM Instance
- Querying DDM Engine Information
- Querying DDM Node Classes Available in an AZ
- Changing the Node Class of a DDM Instance
- Obtaining the Instance Group Information
- Creating an Instance Group
- Schemas
- Accounts
- Monitoring
- Session Management
- Application Examples
-
DDM Instances
- Permissions Policies and Supported Actions
- Appendix
- SDK Reference
-
Best Practices
- Overview
- Formulating Sharding Rules
- Determining the Number of Shards in a Schema
- Using Broadcast and Unsharded Tables
- Transaction Models
- SQL Standards
- Migrating an Entire RDS Database to DDM
- Migrating an Entire MyCat Database to DDM
- Accessing DDM Using a JDBC Connection Pool
- Logging In to a DDM Instance Using Navicat
- Migrating Data from RDS for MySQL to DDM Using DRS
- Sharding Database and Table Data of an RDS for MySQL Instance
- Performance White Paper
-
FAQs
- General Questions
-
DDM Usage
- How Does DDM Perform Sharding?
- What Do I Do If I Fail to Connect to a DDM Instance Using the JDBC Driver?
- Why It Takes So Long Time to Export Data from MySQL Using mysqldump?
- What Do I Do If a Duplicate Primary Key Error Occurs When Data Is Imported into DDM?
- What Should I Do If an Error Message Is Returned When I Specify an Auto-Increment Primary Key During Migration?
- What Do I Do If an Error Is Reported When Parameter Configuration Does Not Time Out?
- Which Should I Delete First, a Schema or its Associated RDS Instances?
- Can I Manually Delete Databases and Accounts Remained in Data Nodes After a Schema Is Deleted?
- SQL Syntax
-
RDS-related Questions
- Is the Name of a Database Table Case-Sensitive?
- What Risky Operations on RDS for MySQL Will Affect DDM?
- How Do I Handle Data with Duplicate Primary Keys in a Table?
- How Can I Query RDS for MySQL Information by Running Command show full innodb status?
- What Should I Pay Attention to When Selecting RDS for MySQL Instance Specifications?
- Connection Management
- Resource Freezing, Release, Deletion, and Unsubscription
- Videos
-
More Documents
-
User Guide (ME-Abu Dhabi Region)
- Service Overview
- Getting Started
- Function Overview
- Instance Management
-
Parameter Template Management
- Creating a Parameter Template
- Editing a Parameter Template
- Comparing Two Parameter Templates
- Viewing Parameter Change History
- Replicating 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
- Task Center
- Schema Management
- Account Management
- Backup Management
- Monitoring Management
- Auditing
-
SQL Syntax
- Introduction
- DDL
- DML
- Functions
- Unsupported Items
- Supported SQL Statements
- Global Sequence
- Database Management Syntax
- Advanced SQL Functions
-
FAQs
- General Questions
-
DDM Usage
- How Can I Rectify a Fault in Accessing DDM by Using the JDBC Driver?
- What Version and Parameters Should I Select?
- Why It Takes So Long Time to Export Data from MySQL Using mysqldump?
- How Should I Handle the Duplicate Primary Key Error Occurring After Data Is Imported into DDM?
- What Should I Do If an Error Message Is Returned After I Specify an Auto-Increment Primary Key?
- How Do I Handle the Error Reported When Parameter Configuration Does Not Time Out?
- Which Should I Delete First, Schema or Associated RDS DB Instances?
- Should I Manually Delete Databases and Accounts Remained in the Associated RDS DB Instances After a Schema Is Deleted?
- SQL Syntax
- RDS-related Questions
- Connection Management
-
User Guide (Kuala Lumpur Region)
- Service Overview
- Getting Started
- Function Overview
- Instance Management
-
Parameter Template Management
- Creating a Parameter Template
- Editing a Parameter Template
- Comparing Two Parameter Templates
- Viewing Parameter Change History
- Replicating 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
- Task Center
- Schema Management
- Account Management
- Backup Management
- Monitoring Management
- Auditing
-
SQL Syntax
- Introduction
- DDL
- DML
- Functions
- Unsupported Items
- Supported SQL Statements
- Global Sequence
- Database Management Syntax
- Advanced SQL Functions
-
FAQs
- General Questions
-
DDM Usage
- How Can I Rectify a Fault in Accessing DDM by Using the JDBC Driver?
- What Version and Parameters Should I Select?
- Why It Takes So Long Time to Export Data from MySQL Using mysqldump?
- How Should I Handle the Duplicate Primary Key Error Occurring After Data Is Imported into DDM?
- What Should I Do If an Error Message Is Returned After I Specify an Auto-Increment Primary Key?
- How Do I Handle the Error Reported When Parameter Configuration Does Not Time Out?
- Which Should I Delete First, Schema or Associated RDS DB Instances?
- Should I Manually Delete Databases and Accounts Remained in the Associated RDS DB Instances After a Schema Is Deleted?
- SQL Syntax
- RDS-related Questions
- Connection Management
-
API Reference (Kuala Lumpur Region)
- Before You Start
- API Overview
- Calling APIs
-
DDM Instance Management
- Querying DDM Engine
- Querying the Quota of Classes Available in Each AZ
- Creating a DDM Instance
- Querying DDM Instances
- Viewing Details of a DDM Instance
- Modifying the Name of a DDM Instance
- Modifying the Security Group of a DDM Instance
- Deleting a DDM Instance
- Restarting a DDM Instance
- Reloading Table Data
- Scaling Out a DDM instance
- Scaling In a DDM instance
- Modifying the Read Policy of the Associated DB Instance
- Synchronizing DB Instance Data
- Querying Nodes of a DDM Instance
- Querying Details of a DDM Instance Node
- Querying Parameters of a Specified DDM Instance
- Modifying Parameters of a DDM Instance
- Schema Management
- Account Management
- Monitoring Management
- Permissions Policies and Supported Actions
- Appendix
- Change History
-
User Guide (ME-Abu Dhabi Region)
- General Reference
Show all
Copied.
Operation Guide
This section uses an RDS for MySQL instance as an example to describe how to configure shards for a schema.
Prerequisites
- There is a DDM instance with available schemas.
- There is an RDS for MySQL instance in the same VPC as the DDM instance, and is not associated with any other DDM instances. If adding data nodes is required, ensure that the new data nodes are in the same VPC as the DDM instance.
- The kernel version of the DDM instance must be 3.0.8.3 or later. The latest kernel version is recommended.
- Ensure that the instances to be associated with your schema cannot be in read-only states.
- Unsharded schemas do not support shard configuration.
Procedure
- Log in to the DDM console.
- In the instance list, locate the instance that you want to configure shards for and click its name.
- On the displayed page, choose Schemas to view schemas of the DDM instance.
- In the schema list, locate the schema that you want to configure shards for and click Configure Shards in the Operation column.
Figure 1 Configuring shards
- On the Configure Shards page, configure the required parameters and click Test Availability.
Figure 2 Configuring shards
Table 1 Parameter description Parameter
Description
Current DB Instances and Shards
Displays the information of current DB instances and shards.
Total Shards After Configuration
Defaults to the total number of existing shards in the schema. If you want to increase shards, change the default value to the new total number of shards, and DDM will distribute all shards evenly to all data nodes.
Execution Node Type
The default value is Shared. You can change the execution node type based on service requirements.
- Shared: The node is responsible not only for configuring shards, but also for handling service requests. So, shard configuration is slower.
- Dedicated: The execution node will be dedicated to configuring shards, so shard configuration is faster. If you are worried about not having enough nodes to handle your services, add more nodes before configuring shards.
If you select Dedicated for the execution node type, enable load balancing for the default group and ensure that the number of nodes exceeds one.
Route Switchover
Both manual and automatic switchover are supported.
Read and write requests involved will be switched to new DB instances. During the switchover, one or two intermittent disconnections may occur but do not affect your services. You are advised to perform the switchover during peak-off hours.
DB Instance
An existing instance is selected by default. You can determine whether to add DB instances based on service requirements.
You need to input the required password for testing connectivity. Only after the connectivity test is successful, you can go to the next step.
NOTE:
- Tables without primary keys do not support shard configuration.
- The number of physical shards per data node in the schema cannot exceed 64. If more than 64 shards are required, contact DDM customer service.
- Required permissions: SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER WITH GRANT OPTION
- After the test is successful, click Next to go to the Precheck page.
Figure 3 Pre-check
NOTE:
- Precheck is not the start of shard configuration. The configuration task does not start until you click OK.
- Handle risks first if any. You can also ignore the risks if you ensure that they do not affect your services.
- After all check items are complete, click Configure shards.
- The shard configuration task is in progress. A data migration task is performed in two phases, full migration and increment migration, respectively.
You can view the migration progress on the Task Center page.
You can click
next to the task to view task details, including shards and data nodes before and after the shard configuration, and switchover policy.
Figure 4 Viewing progress of a shard configuration taskYou can run show migrate status on a SQL client to view progress of the shard configuration task.Figure 5 Running the required command to view task progressNOTE:
The number of returned records corresponds to the number of source RDS instances.
SOURCE_RDS: indicates the source RDS instance.
MIGRATE_ID: indicates the ID of the task of configuring shards.
SUCCEED_TABLE_STRUCTURE: indicates the number of physical tables whose structure data has been migrated.
TOTAL_TABLE_STRUCTURE: indicates the total number of physical tables whose structure data is to be migrated.
SUCCEED_TABLE_DATA: indicates the number of physical tables whose data records have been migrated.
TOTAL_TABLE_DATA: indicates the number of physical tables whose data records are to be migrated.
SUCCEED_INDEX_DATA: indicates the number of physical tables whose indexes have been migrated.
TOTAL_INDEX_DATA: indicates the number of physical tables whose data records are to be migrated.
FULL_SUCCEED_COUNT: indicates the objects that have finished a full migration in the current scale-out subtask.
FULL_TOTAL_COUNT: indicates all objects that need to be migrated by a full migration in the current scale-out subtask.
FULL_PERCENTAGE: indicates the percentage of migrated objects in the full migration in the current scale-out subtask.
Aggregate total objects to be migrated in a full migration and migrated objects in each scale-out subtask. The total objects to be migrated and migrated in all subtasks are displayed in the progress bar at Task Center.
- On the Task Center page, choose More > Modify Switch Policy in the Operation column.
Figure 6 Modifying switch policy
- On the displayed page, click More > View Log in the Operation column to view task logs.
Figure 7 Viewing logs
- If you select Manual for route switchover, click Switch Route at Task Center after data is completely migrated. If you select Automatic, the route is automatically switched over within the specified time.
Figure 8 Manual switchover
NOTE:
- Switching route is critical for a shard configuration task. Before the route is switched, you can cancel a shard configuration task, and data in original databases is not affected.
- If a new RDS for MySQL instances is added, write operations will be disabled during route switchover. If the number of shards is increased, read and write operations are both disabled during route switchover.
- Switching route during off-peak hours is recommended. This is because data validation is required during this process, increasing the switchover time. How long route switchover requires depends on the volume of the data involved.
- The shard configuration task is in progress. A data migration task is performed in two phases, full migration and increment migration, respectively.
- Click Clear in the Operation column to delete the data migrated from original RDS for MySQL instances.
Figure 9 Clearing data
- Carefully read information in the dialog box, confirm that the task is correct, and click Yes.
- Wait till the source data is cleared.
Figure 10 Old data deleted successfully
NOTE:
Old data can be deleted by the DROP statement. After the deletion, storage space may not be released immediately due to MySQL constraints.
- Run the following commands after the shard configuration is complete:
show data node: used to view the relationship between new data nodes and shards.
show db status: used to view the estimated usage of schema disks.
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