Files
doc-exports/docs/ddm/umn/ddm_03_0071.html
Ru, Li Yi 4b09a03a51 ddm_umn
Reviewed-by: Wagner, Fabian <fabian.wagner@t-systems.com>
Co-authored-by: Ru, Li Yi <liyiru7@huawei.com>
Co-committed-by: Ru, Li Yi <liyiru7@huawei.com>
2024-04-11 11:39:26 +00:00

40 lines
10 KiB
HTML

<a name="ddm_03_0071"></a><a name="ddm_03_0071"></a>
<h1 class="topictitle1">Operation Guide</h1>
<div id="body0000001321680717"><p id="ddm_03_0071__p157601320517">This section uses an RDS for MySQL instance as an example to describe how to configure shards for a schema.</p>
<div class="section" id="ddm_03_0071__s2e6dd0a283024771aff961abc306652a"><h4 class="sectiontitle">Prerequisites</h4><ul id="ddm_03_0071__ul53173579195"><li id="ddm_03_0071__li631720576190">There is a DDM instance with available schemas.</li><li id="ddm_03_0071__li9882171411145">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.</li><li id="ddm_03_0071__li1039269145815">The kernel version of the DDM instance must be 3.0.8.3 or later. The latest kernel version is recommended.</li><li id="ddm_03_0071__li91761054192819">Ensure that the instances to be associated with your schema cannot be in read-only states.</li></ul>
</div>
<div class="section" id="ddm_03_0071__section163161793613"><h4 class="sectiontitle">Procedure</h4><ol id="ddm_03_0071__ol12323258"><li id="ddm_03_0071__li1135718381115"><span>Log in to the DDM console. In the instance list, locate the instance that you want to configure shards for and click its name.</span></li><li id="ddm_03_0071__li58659836"><span>On the displayed page, choose <strong id="ddm_03_0071__b8184153152316">Schemas</strong> to view schemas of the DDM instance.</span></li><li id="ddm_03_0071__li3554164620431"><span>In the schema list, locate the schema that you want to configure shards for and click <strong id="ddm_03_0071__b669823812315">Configure Shards</strong> in the <strong id="ddm_03_0071__b14699173815232">Operation</strong> column.</span></li><li id="ddm_03_0071__en-us_topic_0057918826_li57746634"><span>On the <strong id="ddm_03_0071__b626713217244">Configure Shards</strong> page, configure the required parameters and click <strong id="ddm_03_0071__b428812222415">Test Availability</strong>.</span><p><div class="note" id="ddm_03_0071__note137177227516"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="ddm_03_0071__ul1163820125918"><li id="ddm_03_0071__li8825124302812">Tables without primary keys do not support shard configuration.</li><li id="ddm_03_0071__li20649201593"><strong id="ddm_03_0071__b18821855183411">Total Shards After Configuration</strong> 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.</li><li id="ddm_03_0071__li15641920165920">You can increase data nodes or shards. Data will be redistributed across all shards if one or more shards are added.</li><li id="ddm_03_0071__li564120145910">Existing instances are selected by default in the data node list, but you still need to input the required password for testing connections.</li><li id="ddm_03_0071__li186482045914">The number of physical shards per data node in the schema cannot exceed 64. If more than 64 shards are required, contact DDM technical support.</li><li id="ddm_03_0071__li9931954145910">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</li></ul>
</div></div>
</p></li><li id="ddm_03_0071__li17493183494418"><span>After the test is successful, click <strong id="ddm_03_0071__b2561529591">Next</strong> to go to the <strong id="ddm_03_0071__b1536851113614">Precheck</strong> page.</span><p><div class="note" id="ddm_03_0071__note1247112721515"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="ddm_03_0071__ul1247727101520"><li id="ddm_03_0071__li152471427151511">Precheck is not the start of shard configuration. The configuration task does not start until you click <strong id="ddm_03_0071__b247951311362">OK</strong>.</li><li id="ddm_03_0071__li192472277151">Handle risks first if any. You can also ignore the risks if you ensure that they do not affect your services.</li></ul>
</div></div>
</p></li><li id="ddm_03_0071__li193611612918"><span>After all check items are complete, click <strong id="ddm_03_0071__b1969105110363">Configure shards</strong>.</span></li><li id="ddm_03_0071__li7655645131714"><span>View progress at the Task Center or run command <span class="uicontrol" id="ddm_03_0071__uicontrol8112102023018"><b>show migrate status</b></span> on your SQL client to view progress. A shard configuration task consists of two phases: full migration and incremental migration.</span><p><div class="fignone" id="ddm_03_0071__fig38891850183913"><span class="figcap"><b>Figure 1 </b>Run the required command to view task progress</span><br><span><img id="ddm_03_0071__image1480861625816" src="en-us_image_0000001685307342.png"></span></div>
<div class="note" id="ddm_03_0071__note13217192018432"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="ddm_03_0071__p11193416436">The number of returned records corresponds to the number of source RDS instances.</p>
<p id="ddm_03_0071__p18617122224515"><strong id="ddm_03_0071__b1488161010106">SOURCE_RDS</strong>: indicates the source RDS instance.</p>
<p id="ddm_03_0071__p777412295456"><strong id="ddm_03_0071__b3503152919103">MIGRATE_ID</strong>: indicates the scale-out task ID.</p>
<p id="ddm_03_0071__p4957103713451"><strong id="ddm_03_0071__b114835351607">SUCCEED_TABLE_STRUCTURE</strong>: indicates the number of physical tables whose structure data has been migrated.</p>
<p id="ddm_03_0071__p201708147419"><strong id="ddm_03_0071__b181751616217">TOTAL_TABLE_STRUCTURE</strong>: indicates the total number of physical tables whose structure data is to be migrated.</p>
<p id="ddm_03_0071__p143501646134516"><strong id="ddm_03_0071__b1064319320210">SUCCEED_TABLE_DATA</strong>: indicates the number of physical tables whose data records have been migrated.</p>
<p id="ddm_03_0071__p910913344217"><strong id="ddm_03_0071__b48941431928">TOTAL_TABLE_DATA</strong>: indicates the number of physical tables whose data records are to be migrated.</p>
<p id="ddm_03_0071__p279945294518"><strong id="ddm_03_0071__b51581671733">SUCCEED_INDEX_DATA</strong>: indicates the number of physical tables whose indexes have been migrated.</p>
<p id="ddm_03_0071__p17279864413"><strong id="ddm_03_0071__b61405106310">TOTAL_INDEX_DATA</strong>: indicates the number of physical tables whose data records are to be migrated.</p>
<p id="ddm_03_0071__p5366145467"><strong id="ddm_03_0071__b954305115561">FULL_SUCCEED_COUNT</strong>: indicates the objects that have finished a full migration in the current scale-out subtask.</p>
<p id="ddm_03_0071__p15899141184610"><strong id="ddm_03_0071__b4112325145717">FULL_TOTAL_COUNT</strong>: indicates all objects that need to be migrated by a full migration in the current scale-out subtask.</p>
<p id="ddm_03_0071__p76809165492"><strong id="ddm_03_0071__b1530111383575">FULL_PERCENTAGE</strong>: indicates the percentage of migrated objects in the full migration in the current scale-out subtask.</p>
<p id="ddm_03_0071__p12217182014314">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.</p>
</div></div>
</p></li><li id="ddm_03_0071__li844574213420"><span>At the Task Center, click <strong id="ddm_03_0071__b1831913356144">View Log</strong> to view task logs.</span></li><li id="ddm_03_0071__li370914131526"><span>If you select <strong id="ddm_03_0071__b1921523742915">Manual</strong> for route switchover, click <strong id="ddm_03_0071__b19215163717295">Switch Route</strong> at Task Center after data is completely migrated. If you select <strong id="ddm_03_0071__b206395816346">Automatic</strong>, the route is automatically switched over within the specified time.</span><p><div class="p" id="ddm_03_0071__p1517957164415"><div class="note" id="ddm_03_0071__note835862420199"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="ddm_03_0071__ul999642714125"><li id="ddm_03_0071__li164511252176">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.</li><li id="ddm_03_0071__li207401139214">If new RDS for MySQL instances are 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.</li><li id="ddm_03_0071__li1874019320215">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.</li></ul>
</div></div>
</div>
</p></li><li id="ddm_03_0071__li10373133311511"><span>Click <strong id="ddm_03_0071__b2135616194719">Clear</strong> in the <strong id="ddm_03_0071__b16391162154720">Operation</strong> column to delete the data migrated from original RDS for MySQL instances.</span></li><li id="ddm_03_0071__li10671106572"><span>Carefully read information in the dialog box, confirm that the task is correct, and click <strong id="ddm_03_0071__b11425184254711">Yes</strong>.</span></li><li id="ddm_03_0071__li1385314518810"><span>Wait till the source data is cleared.</span></li><li id="ddm_03_0071__li10188922155511"><span>Run the following commands after the shard configuration is complete:</span><p><p id="ddm_03_0071__p184441510563"><strong id="ddm_03_0071__b1926732634914">show data node</strong>: used to view the relationship between new data nodes and shards</p>
<p id="ddm_03_0071__p124444118563"><strong id="ddm_03_0071__b790610249568">show db status</strong>: used to view the estimated usage of schema disks.</p>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="ddm_03_0131.html">Shard Configuration</a></div>
</div>
</div>