Files
doc-exports/docs/dcs/umn/dcs-migration-0312006.html
Chen, Junjie 748ac2c008 DCS UMN 20230811 version
Reviewed-by: Mützel, Andrea <andrea.muetzel@t-systems.com>
Co-authored-by: Chen, Junjie <chenjunjie@huawei.com>
Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
2024-01-24 14:13:13 +00:00

73 lines
20 KiB
HTML

<a name="dcs-migration-0312006"></a><a name="dcs-migration-0312006"></a>
<h1 class="topictitle1">Online Migration from Another Cloud</h1>
<div id="body1605611574151"><div class="section" id="dcs-migration-0312006__dcs-migration-190703003_section113421435300"><h4 class="sectiontitle">Application Scenarios</h4><p id="dcs-migration-0312006__dcs-migration-190703003_p1244713381103">If the source and target instances are interconnected and the <strong id="dcs-migration-0312006__dcs-migration-190703003_b18112161719418">SYNC</strong> and <strong id="dcs-migration-0312006__dcs-migration-190703003_b01122172041">PSYNC</strong> commands are supported by the source instance, data can be migrated online in full or incrementally from the source to the target.</p>
<div class="caution" id="dcs-migration-0312006__dcs-migration-190703003_note8576142111415"><span class="cautiontitle"><img src="public_sys-resources/caution_3.0-en-us.png"> </span><div class="cautionbody"><ul id="dcs-migration-0312006__dcs-migration-190703003_ul12488164523510"><li id="dcs-migration-0312006__dcs-migration-190703003_li3488545193514">If the <strong id="dcs-migration-0312006__dcs-migration-190703003_b18144137133010">SYNC</strong> and <strong id="dcs-migration-0312006__dcs-migration-190703003_b11144475309">PSYNC</strong> commands are disabled on the source Redis instance, enable them before performing online migration. Otherwise, the migration fails. If you use a DCS Redis instance for online migration, the <strong id="dcs-migration-0312006__dcs-migration-190703003_b814416793016">SYNC</strong> command is automatically enabled.</li><li id="dcs-migration-0312006__dcs-migration-190703003_li10440349183519">You cannot use public networks for online migration.</li><li id="dcs-migration-0312006__dcs-migration-190703003_li14846184712514">During online migration, you are advised to set <strong id="dcs-migration-0312006__dcs-migration-190703003_b9548141910176">repl-timeout</strong> on the source instance to 300s and <strong id="dcs-migration-0312006__dcs-migration-190703003_b16885030121716">client-output-buffer-limit</strong> to 20% of the maximum memory of the instance.</li><li id="dcs-migration-0312006__dcs-migration-190703003_li665420105315">The source must be Redis 3.0 or later.</li></ul>
</div></div>
</div>
<div class="section" id="dcs-migration-0312006__dcs-migration-190703003_section77251317153217"><h4 class="sectiontitle">Impacts on Services</h4><p id="dcs-migration-0312006__dcs-migration-190703003_p5721132883218">During online migration, data is essentially synchronized in full to a new replica. Therefore, perform online migration during low-demand hours.</p>
</div>
<div class="section" id="dcs-migration-0312006__dcs-migration-190703003_section15790816165711"><h4 class="sectiontitle">Prerequisites</h4><ul id="dcs-migration-0312006__dcs-migration-190703003_ul56215114194"><li id="dcs-migration-0312006__dcs-migration-190703003_li963201191917">Before migrating data, read through <a href="dcs-migration-090626002.html">Migration Tools and Schemes</a> to learn about the DCS data migration function and select an appropriate target instance.</li><li id="dcs-migration-0312006__dcs-migration-190703003_li2988793125">By default, a cluster instance has only one DB (DB0). Before you migrate data from a multi-DB single-node or master/standby instance to a Redis Cluster instance, check whether any data exists on databases other than DB0. To ensure that the migration succeeds, move all data to DB0 by referring to <a href="dcs-migration-090626001_0.html">Online Migration with Rump</a>.</li></ul>
</div>
<div class="section" id="dcs-migration-0312006__dcs-migration-190703003_section760319488490"><h4 class="sectiontitle">Step 1: Obtain the Source Redis Address</h4><p id="dcs-migration-0312006__dcs-migration-190703003_p136671818181819">Obtain the IP address/domain name and port number of the source Redis instance.</p>
</div>
<div class="section" id="dcs-migration-0312006__dcs-migration-190703003_section1128152020384"><h4 class="sectiontitle">Step 2: Prepare the Target DCS Redis Instance</h4><ul id="dcs-migration-0312006__dcs-migration-190703003_ul727834515383"><li id="dcs-migration-0312006__dcs-migration-190703003_li1527810451382">If a target DCS Redis instance is not available, create one first. For details, see <a href="dcs-ug-0312003.html">Creating a DCS Redis Instance</a>.</li><li id="dcs-migration-0312006__dcs-migration-190703003_li5270324091">If you already have a DCS Redis instance, you do not need to create one again, but you need to clear the instance data before the migration. For details, see <a href="dcs-ug-0312018.html">Clearing DCS Instance Data</a>.<p id="dcs-migration-0312006__dcs-migration-190703003_p49291961936">If the target instance data is not cleared before the migration and the source and target instances contain the same key, the key in the target instance will be overwritten by the key in the source instance after the migration.</p>
</li></ul>
</div>
<div class="section" id="dcs-migration-0312006__dcs-migration-190703003_section84284075116"><h4 class="sectiontitle">Step 3: Check the Network</h4><ol id="dcs-migration-0312006__dcs-migration-190703003_ol1260417035216"><li id="dcs-migration-0312006__dcs-migration-190703003_li16049019525"><span>Check whether the source Redis instance, the target Redis instance, and the migration task are configured with the same VPC.</span><p><p id="dcs-migration-0312006__dcs-migration-190703003_p188021330165115">If yes, go to <a href="#dcs-migration-0312006__dcs-migration-190703003_section157769524519">Step 4: Create an Online Migration Task</a>. If no, go to <a href="#dcs-migration-0312006__dcs-migration-190703003_li160420185217">2</a>.</p>
</p></li><li id="dcs-migration-0312006__dcs-migration-190703003_li160420185217"><a name="dcs-migration-0312006__dcs-migration-190703003_li160420185217"></a><a name="dcs-migration-190703003_li160420185217"></a><span>Check whether the VPCs configured for the source Redis instance, the target Redis instance, and the migration task are connected to ensure that the VM resource of the migration task can access the source and target Redis instances.</span><p><p id="dcs-migration-0312006__dcs-migration-190703003_p1480253095111">If yes, go to <a href="#dcs-migration-0312006__dcs-migration-190703003_section157769524519">Step 4: Create an Online Migration Task</a>. If no, go to <a href="#dcs-migration-0312006__dcs-migration-190703003_li423483319412">3</a>.</p>
</p></li><li id="dcs-migration-0312006__dcs-migration-190703003_li423483319412"><a name="dcs-migration-0312006__dcs-migration-190703003_li423483319412"></a><a name="dcs-migration-190703003_li423483319412"></a><span>Perform the following operations to establish the network.</span><p><ul id="dcs-migration-0312006__dcs-migration-190703003_ul17325432414"><li id="dcs-migration-0312006__dcs-migration-190703003_li7271615152516">If the source and target Redis instances are <span id="dcs-migration-0312006__dcs-migration-190703003_ph749662795514">in the same DCS region</span>, create a VPC peering connection by referring to "VPC Peering Connection" in the <em id="dcs-migration-0312006__dcs-migration-190703003_i4602173825519">Virtual Private Cloud User Guide</em>.</li><li id="dcs-migration-0312006__dcs-migration-190703003_li1073215431842">If the source and target Redis instances are on different clouds or in different regions, create a connection by referring to the <em id="dcs-migration-0312006__dcs-migration-190703003_i22974405618">Direct Connect User Guide</em>.</li></ul>
</p></li></ol>
</div>
<div class="section" id="dcs-migration-0312006__dcs-migration-190703003_section157769524519"><a name="dcs-migration-0312006__dcs-migration-190703003_section157769524519"></a><a name="dcs-migration-190703003_section157769524519"></a><h4 class="sectiontitle">Step 4: Create an Online Migration Task</h4><ol id="dcs-migration-0312006__dcs-migration-190703003_ol81391154144716"><li id="dcs-migration-0312006__dcs-migration-190703003_li390016374490"><span>Log in to the DCS console.</span></li><li id="dcs-migration-0312006__dcs-migration-190703003_li16119587498"><span>In the navigation pane, choose <strong id="dcs-migration-0312006__dcs-migration-190703003_b11427641642634">Data Migration</strong>.</span></li><li id="dcs-migration-0312006__dcs-migration-190703003_li67372014165120"><span>Click <strong id="dcs-migration-0312006__dcs-migration-190703003_b61157650142634">Create Online Migration Task</strong>.</span></li><li id="dcs-migration-0312006__dcs-migration-190703003_li1381824764611"><span>Enter the task name and description.</span></li><li id="dcs-migration-0312006__dcs-migration-190703003_li114411588467"><span>Configure the VPC, subnet, and security group for the migration task.</span><p><p id="dcs-migration-0312006__dcs-migration-190703003_p473111475510">The VPC, subnet, and security group facilitate the migration. Ensure that the migration resources can access the source and target Redis instances.</p>
<div class="note" id="dcs-migration-0312006__dcs-migration-190703003_note8226825195811"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="dcs-migration-0312006__dcs-migration-190703003_ul12308184119132"><li id="dcs-migration-0312006__dcs-migration-190703003_li13308204111130">The online migration task uses a tenant IP address (<strong id="dcs-migration-0312006__dcs-migration-190703003_b197811218123710">Migration ECS</strong> displayed on the <strong id="dcs-migration-0312006__dcs-migration-190703003_b167811718103719">Basic Information</strong> page of the task.) If a whitelist is configured for the source or target instance, add the migration IP address to the whitelist or disable the whitelist.</li><li id="dcs-migration-0312006__dcs-migration-190703003_li18308441171318">To allow the VM used by the migration task to access the source and target instances, set an outbound rule for the task's security group to allow traffic through the IP addresses and ports of the source and target instances. By default, all outbound traffic is allowed.</li></ul>
</div></div>
</p></li></ol>
</div>
<div class="section" id="dcs-migration-0312006__dcs-migration-190703003_section14919536272"><h4 class="sectiontitle">Step 5: Configure the Online Migration Task</h4><ol id="dcs-migration-0312006__dcs-migration-190703003_ol20242048298"><li id="dcs-migration-0312006__dcs-migration-190703003_li187884091914"><span>On the <strong id="dcs-migration-0312006__dcs-migration-190703003_b8239202416317">Online Migration</strong> tab page, click <strong id="dcs-migration-0312006__dcs-migration-190703003_b983115204312">Configure</strong> in the row containing the online migration task you just created.</span></li><li id="dcs-migration-0312006__dcs-migration-190703003_li18777171715209"><span>Select a migration type.</span><p><p id="dcs-migration-0312006__dcs-migration-190703003_p72342811211">Supported migration types are <strong id="dcs-migration-0312006__dcs-migration-190703003_b7961135591712">Full</strong> and <strong id="dcs-migration-0312006__dcs-migration-190703003_b1096125531711">Full + Incremental</strong>, which are described in <a href="#dcs-migration-0312006__dcs-migration-190703003_table55653322215">Table 1</a>.</p>
<div class="tablenoborder"><a name="dcs-migration-0312006__dcs-migration-190703003_table55653322215"></a><a name="dcs-migration-190703003_table55653322215"></a><table cellpadding="4" cellspacing="0" summary="" id="dcs-migration-0312006__dcs-migration-190703003_table55653322215" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Migration type description</caption><thead align="left"><tr id="dcs-migration-0312006__dcs-migration-190703003_row5587330229"><th align="left" class="cellrowborder" valign="top" width="27.47%" id="mcps1.3.8.2.2.2.2.2.3.1.1"><p id="dcs-migration-0312006__dcs-migration-190703003_p758103372214">Migration Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="72.53%" id="mcps1.3.8.2.2.2.2.2.3.1.2"><p id="dcs-migration-0312006__dcs-migration-190703003_p1058153311225">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="dcs-migration-0312006__dcs-migration-190703003_row1958203312220"><td class="cellrowborder" valign="top" width="27.47%" headers="mcps1.3.8.2.2.2.2.2.3.1.1 "><p id="dcs-migration-0312006__dcs-migration-190703003_p458153332210">Full</p>
</td>
<td class="cellrowborder" valign="top" width="72.53%" headers="mcps1.3.8.2.2.2.2.2.3.1.2 "><p id="dcs-migration-0312006__dcs-migration-190703003_p125833322217">Suitable for scenarios where services can be interrupted. Data is migrated at one time. <strong id="dcs-migration-0312006__dcs-migration-190703003_b2535184111510">Source instance data updated during the migration will not be migrated to the target instance.</strong></p>
</td>
</tr>
<tr id="dcs-migration-0312006__dcs-migration-190703003_row205815338228"><td class="cellrowborder" valign="top" width="27.47%" headers="mcps1.3.8.2.2.2.2.2.3.1.1 "><p id="dcs-migration-0312006__dcs-migration-190703003_p85863316221">Full + incremental</p>
</td>
<td class="cellrowborder" valign="top" width="72.53%" headers="mcps1.3.8.2.2.2.2.2.3.1.2 "><p id="dcs-migration-0312006__dcs-migration-190703003_p858103352214">Suitable for scenarios requiring minimal service downtime. The incremental migration parses logs to ensure data consistency between the source and target instances.</p>
<p id="dcs-migration-0312006__dcs-migration-190703003_p110411470116">Once the migration starts, it remains <strong id="dcs-migration-0312006__dcs-migration-190703003_b16552211111311">Migrating</strong> until you click <strong id="dcs-migration-0312006__dcs-migration-190703003_b65201171131">Stop</strong> in the <strong id="dcs-migration-0312006__dcs-migration-190703003_b5355163610593">Operation</strong> column. After the migration is stopped, data in the source instance will not be lost, but data will not be written to the target instance. When the transmission network is stable, the delay of incremental migration is within seconds. The actual delay depends on the transmission quality of the network link.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="fignone" id="dcs-migration-0312006__dcs-migration-190703003_fig23511729101218"><span class="figcap"><b>Figure 1 </b>Selecting the migration type</span><br><span><img id="dcs-migration-0312006__dcs-migration-190703003_image2036555461718" src="en-us_image_0291862872.png"></span></div>
</p></li><li id="dcs-migration-0312006__dcs-migration-190703003_li974533414185"><span>Configure source Redis and target Redis.</span><p><ol type="a" id="dcs-migration-0312006__dcs-migration-190703003_ol128193366190"><li id="dcs-migration-0312006__dcs-migration-190703003_li5121433171911">The Redis type can be <strong id="dcs-migration-0312006__dcs-migration-190703003_b1093945910">Redis in the cloud</strong> or <strong id="dcs-migration-0312006__dcs-migration-190703003_b431181211911">Self-hosted Redis</strong> as required.<ul id="dcs-migration-0312006__dcs-migration-190703003_ul445012114211"><li id="dcs-migration-0312006__dcs-migration-190703003_li184511719217"><strong id="dcs-migration-0312006__dcs-migration-190703003_b3442183942010">Redis in the cloud</strong>: a DCS Redis instance (source or target) that is in the same VPC as the migration task. If you select this option, specify a DCS Redis instance.</li><li id="dcs-migration-0312006__dcs-migration-190703003_li127821877221"><strong id="dcs-migration-0312006__dcs-migration-190703003_b1967218566215">Self-hosted Redis</strong>: a DCS Redis instance, Redis in another cloud, or self-hosted Redis. If you select this option, enter Redis addresses.</li></ul>
</li><li id="dcs-migration-0312006__dcs-migration-190703003_li13145145319231">If the instance is password-protected, click <strong id="dcs-migration-0312006__dcs-migration-190703003_b164631019236">Test Connection</strong> to check whether the instance password is correct and whether the network is connected. If the instance is not password-protected, click <strong id="dcs-migration-0312006__dcs-migration-190703003_b54195135235">Test Connection</strong> directly.</li></ol>
</p></li><li id="dcs-migration-0312006__dcs-migration-190703003_li1348442114911"><span>Click <strong id="dcs-migration-0312006__dcs-migration-190703003_b13194159102331">Next</strong>.</span></li><li id="dcs-migration-0312006__dcs-migration-190703003_li3625202214190"><span>Confirm the migration task details and click <strong id="dcs-migration-0312006__dcs-migration-190703003_b46184816117">Submit</strong>.</span><p><p id="dcs-migration-0312006__dcs-migration-190703003_p9625422141910">Go back to the data migration task list. After the migration is successful, the task status changes to <strong id="dcs-migration-0312006__dcs-migration-190703003_b15447174915118">Successful</strong>.</p>
<div class="note" id="dcs-migration-0312006__dcs-migration-190703003_note4427420124517"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="dcs-migration-0312006__dcs-migration-190703003_ul4321452125415"><li id="dcs-migration-0312006__dcs-migration-190703003_li3321952195412">Once incremental migration starts, it remains <strong id="dcs-migration-0312006__dcs-migration-190703003_b12386152711">Migrating</strong> until you click <strong id="dcs-migration-0312006__dcs-migration-190703003_b0238101515715">Stop</strong>.</li><li id="dcs-migration-0312006__dcs-migration-190703003_li23211252175420">To stop a migration task, select the check box on the left of the migration task and click <strong id="dcs-migration-0312006__dcs-migration-190703003_b230619112814">Stop</strong> above the instance list.</li><li id="dcs-migration-0312006__dcs-migration-190703003_li1912563853615">After data migration, duplicate keys will be overwritten.</li></ul>
</div></div>
<p id="dcs-migration-0312006__dcs-migration-190703003_p4880126112412">If the migration fails, click the migration task and check the log on the <strong id="dcs-migration-0312006__dcs-migration-190703003_b1024662118283">Migration Logs</strong> page.</p>
</p></li></ol>
</div>
<div class="section" id="dcs-migration-0312006__dcs-migration-190703003_section3718231268"><h4 class="sectiontitle">Verifying the Migration</h4><p id="dcs-migration-0312006__dcs-migration-190703003_p1571161034711">After the migration is complete, use redis-cli to connect the source and target Redis instances to check data integrity.</p>
<ol id="dcs-migration-0312006__dcs-migration-190703003_ol11257313194715"><li id="dcs-migration-0312006__dcs-migration-190703003_li94593118471">Connect to the source Redis and the target Redis.</li><li id="dcs-migration-0312006__dcs-migration-190703003_li10257713154717">Run the <strong id="dcs-migration-0312006__dcs-migration-190703003_b5674145372816">info keyspace</strong> command to check the values of <strong id="dcs-migration-0312006__dcs-migration-190703003_b6780111112291">keys</strong> and <strong id="dcs-migration-0312006__dcs-migration-190703003_b20825181414299">expires</strong>.<p id="dcs-migration-0312006__dcs-migration-190703003_p203461224529"><span><img id="dcs-migration-0312006__dcs-migration-190703003_image152912031408" src="en-us_image_0293255709.png"></span></p>
</li><li id="dcs-migration-0312006__dcs-migration-190703003_li1878042516480">Calculate the differences between the values of <strong id="dcs-migration-0312006__dcs-migration-190703003_b7585046192918">keys</strong> and <strong id="dcs-migration-0312006__dcs-migration-190703003_b2585204614294">expires</strong> of the source Redis and the target Redis. If the differences are the same, the data is complete and the migration is successful.</li></ol>
<p id="dcs-migration-0312006__dcs-migration-190703003_p68531049182811">During full migration, source Redis data updated during the migration will not be migrated to the target instance.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dcs-migration-0312005.html">Migrating Redis Data from Another Cloud to DCS</a></div>
</div>
</div>