forked from docs/doc-exports
Reviewed-by: Kacur, Michal <michal.kacur@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
58 lines
17 KiB
HTML
58 lines
17 KiB
HTML
<a name="EN-US_TOPIC_0000001466594838"></a><a name="EN-US_TOPIC_0000001466594838"></a>
|
|
|
|
<h1 class="topictitle1">Redistributing Data</h1>
|
|
<div id="body0000001134434168"><p id="EN-US_TOPIC_0000001466594838__p8060118">Data redistribution, where data in existing nodes is evenly allocated to the new nodes after you scale out a cluster, is a time-consuming yet crucial task that accelerates service response.</p>
|
|
<p id="EN-US_TOPIC_0000001466594838__p1923312232718">By default, redistribution is automatically started after cluster scale-out. For enhanced reliability, disable the automatic redistribution function and manually start a redistribution task after the scale-out is successful. In this way, both scale-out and redistribution can be retried upon failures.</p>
|
|
<p id="EN-US_TOPIC_0000001466594838__p1986711918558">Currently, <a href="#EN-US_TOPIC_0000001466594838__section858715017148">offline redistribution</a>, <a href="#EN-US_TOPIC_0000001466594838__section2706112181411">online redistribution</a>, <span id="EN-US_TOPIC_0000001466594838__ph752361519591">and <a href="#EN-US_TOPIC_0000001466594838__section3137102712147">Offline Scheduling</a></span> are supported. The default mode is offline redistribution.</p>
|
|
<div class="notice" id="EN-US_TOPIC_0000001466594838__note147861811023"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><ul id="EN-US_TOPIC_0000001466594838__ul0247703714"><li id="EN-US_TOPIC_0000001466594838__li52471101172">The cluster redistribution function is supported in 8.1.1.200 or later.</li><li id="EN-US_TOPIC_0000001466594838__li024720014712">This function can be manually enabled only when the cluster task information displays <strong id="EN-US_TOPIC_0000001466594838__b4759738439021">To be redistributed</strong> after scale-out.</li><li id="EN-US_TOPIC_0000001466594838__li162472011715">You can also select the redistribution mode when you configure cluster scale-out (see <a href="dws_01_0023.html#EN-US_TOPIC_0000001466914106__li1283703664815">Configure advanced parameters</a>).</li></ul>
|
|
</div></div>
|
|
<div class="section" id="EN-US_TOPIC_0000001466594838__section858715017148"><a name="EN-US_TOPIC_0000001466594838__section858715017148"></a><a name="section858715017148"></a><h4 class="sectiontitle">Offline Redistribution</h4><p id="EN-US_TOPIC_0000001466594838__p6133369155"><strong id="EN-US_TOPIC_0000001466594838__b9288175116382">Precautions</strong></p>
|
|
<ul id="EN-US_TOPIC_0000001466594838__ul1745623515238"><li id="EN-US_TOPIC_0000001466594838__li104567359233">In offline redistribution mode, the database does not support DDL and DCL operations. Tables that are being redistributed support only simple DQL operations.</li><li id="EN-US_TOPIC_0000001466594838__li1045633582310">During table redistribution, a shared lock is added to tables. All insert, update, and delete operations as well as DDL operations on the tables are blocked for a long time, which may cause a lock wait timeout. Do not perform queries that take more than 20 minutes during the redistribution (the default time for applying for the write lock during redistribution is 20 minutes). Otherwise, data redistribution may fail due to lock wait timeout.</li></ul>
|
|
<p id="EN-US_TOPIC_0000001466594838__p7776234114214"><strong id="EN-US_TOPIC_0000001466594838__b168977404404">Procedure</strong></p>
|
|
</div>
|
|
<ol id="EN-US_TOPIC_0000001466594838__ol9180552003"><li id="EN-US_TOPIC_0000001466594838__li391312411317"><span>Log in to the GaussDB(DWS) management console.</span></li><li id="EN-US_TOPIC_0000001466594838__li11952509114244"><span>Click <span class="uicontrol" id="EN-US_TOPIC_0000001466594838__uicontrol038394504011"><b>Clusters</b></span>. All clusters are displayed by default.</span></li><li id="EN-US_TOPIC_0000001466594838__li25916796163327"><span>In the <span class="parmname" id="EN-US_TOPIC_0000001466594838__parmname347910502403"><b>Operation</b></span> column of the target cluster, choose <strong id="EN-US_TOPIC_0000001466594838__b980418271176">More</strong> > <strong id="EN-US_TOPIC_0000001466594838__b65453351873">Scale Node</strong> > <strong id="EN-US_TOPIC_0000001466594838__b268320376713">Redistribute</strong>, as shown in the following figure.</span><p><p id="EN-US_TOPIC_0000001466594838__p67015478161155"></p>
|
|
<p id="EN-US_TOPIC_0000001466594838__p893823571517"><span><img id="EN-US_TOPIC_0000001466594838__image17998613270" src="figure/en-us_image_0000001466914322.png" width="478.475879" height="141.188145" title="Click to enlarge" class="imgResize"></span></p>
|
|
</p></li><li id="EN-US_TOPIC_0000001466594838__li3876347182410"><span>On the <strong id="EN-US_TOPIC_0000001466594838__b1964717586539">Redistribute</strong> page that is displayed, keep the default <strong id="EN-US_TOPIC_0000001466594838__b48921849135410">offline</strong> redistribution mode and click <strong id="EN-US_TOPIC_0000001466594838__b142682523545">Next: Confirm</strong> to submit the task.</span><p><p id="EN-US_TOPIC_0000001466594838__p14861112022015"><span><img id="EN-US_TOPIC_0000001466594838__image1312293052010" src="figure/en-us_image_0000001518033865.png" width="407.9775" height="195.212745" title="Click to enlarge" class="imgResize"></span></p>
|
|
<p id="EN-US_TOPIC_0000001466594838__p177881679282"><span><img id="EN-US_TOPIC_0000001466594838__image13592112102816" src="figure/en-us_image_0000001466914318.png" width="407.9775" height="301.018634" title="Click to enlarge" class="imgResize"></span></p>
|
|
<p id="EN-US_TOPIC_0000001466594838__p1330110501431"><span><img id="EN-US_TOPIC_0000001466594838__image56671450114320" src="figure/en-us_image_0000001466754690.png" width="408.975" height="136.74621100000002" title="Click to enlarge" class="imgResize"></span></p>
|
|
</p></li></ol>
|
|
<div class="section" id="EN-US_TOPIC_0000001466594838__section2706112181411"><a name="EN-US_TOPIC_0000001466594838__section2706112181411"></a><a name="section2706112181411"></a><h4 class="sectiontitle">Online Redistribution</h4><p id="EN-US_TOPIC_0000001466594838__p336124191612"><strong id="EN-US_TOPIC_0000001466594838__b12324235124117">Precautions</strong></p>
|
|
<p id="EN-US_TOPIC_0000001466594838__p15631715124312">In online redistribution mode, the database supports partial DDL and DCL operations.</p>
|
|
<ul id="EN-US_TOPIC_0000001466594838__ul9544163015212"><li id="EN-US_TOPIC_0000001466594838__la27ccd2b46984274912e6e15e0bdd764">Local tables that are being redistributed support insert, delete and update operations and some DDL operations:<ul id="EN-US_TOPIC_0000001466594838__u075e758259d14996a6bbbaa99b493a31"><li id="EN-US_TOPIC_0000001466594838__l5ebba28d593f415b8cd88171c91ec873"><strong id="EN-US_TOPIC_0000001466594838__b105321210135715">INSERT</strong>, <strong id="EN-US_TOPIC_0000001466594838__b11532111013572">DELETE</strong>, <strong id="EN-US_TOPIC_0000001466594838__b9532151055713">UPDATE</strong>, <strong id="EN-US_TOPIC_0000001466594838__b1153251020570">MERGE INTO</strong>, <strong id="EN-US_TOPIC_0000001466594838__b1679017189217">OVERWRITE</strong>, <strong id="EN-US_TOPIC_0000001466594838__b17167171021">UPSERT</strong></li><li id="EN-US_TOPIC_0000001466594838__en-us_topic_0085032684_li1366408804">Join queries across node groups</li><li id="EN-US_TOPIC_0000001466594838__l15deea8c003d4ab1a59ee97028d2b167">Local table renaming, schema modification, <strong id="EN-US_TOPIC_0000001466594838__b1560117586010">DROP</strong>, <strong id="EN-US_TOPIC_0000001466594838__b4602125812014">TRUNCATE</strong>, <strong id="EN-US_TOPIC_0000001466594838__b76022581608">TRUNCATE-PARTITION</strong></li></ul>
|
|
</li></ul>
|
|
<ul id="EN-US_TOPIC_0000001466594838__ul1658410112232"><li id="EN-US_TOPIC_0000001466594838__li209859974916">The following operations cannot be performed on tables that are being redistributed:<ul id="EN-US_TOPIC_0000001466594838__ul723316865117"><li id="EN-US_TOPIC_0000001466594838__li723348115111">Run <strong id="EN-US_TOPIC_0000001466594838__b1010351016318">ALTER TABLE</strong> statements (except for <strong id="EN-US_TOPIC_0000001466594838__b1610321010314">TRUNCATE PARTITION</strong>), including adding or deleting columns or partitions.</li><li id="EN-US_TOPIC_0000001466594838__li09239385527">Create, modify, or delete indexes.</li><li id="EN-US_TOPIC_0000001466594838__li88712558533">Run <strong id="EN-US_TOPIC_0000001466594838__b158066198413">VACUUM FULL</strong> or <strong id="EN-US_TOPIC_0000001466594838__b20806119648">CLUSTER</strong> on tables.</li><li id="EN-US_TOPIC_0000001466594838__li1441124125419">Modify the sequence objects on which a column depends, including creating and modifying them. Typical statements are <strong id="EN-US_TOPIC_0000001466594838__b49321220458">CREATE</strong> and <strong id="EN-US_TOPIC_0000001466594838__b159329201657">ALTER SEQUENCE ... OWNED BY</strong>.</li><li id="EN-US_TOPIC_0000001466594838__li19905122712218">During the redistribution of a table with more than 996 columns, <strong id="EN-US_TOPIC_0000001466594838__b4889175511152">UPDATE</strong> and <strong id="EN-US_TOPIC_0000001466594838__b1676135731516">DELETE</strong> statements cannot be executed. <strong id="EN-US_TOPIC_0000001466594838__b19981835131619">SELECT</strong> and <strong id="EN-US_TOPIC_0000001466594838__b3362103611163">INSERT</strong> statements are allowed.</li><li id="EN-US_TOPIC_0000001466594838__li18154172112012">Database and tablespace objects cannot be created, deleted, or modified during redistribution.</li><li id="EN-US_TOPIC_0000001466594838__li14707195135612">A partition swap can be performed only if the redistribution is complete for both of the tables to be swapped. The two tables belong to different node groups and do not allow partition swap if either of them is being redistributed.</li></ul>
|
|
</li></ul>
|
|
<p id="EN-US_TOPIC_0000001466594838__p17211103178"><strong id="EN-US_TOPIC_0000001466594838__b890847340">Procedure</strong></p>
|
|
<ol id="EN-US_TOPIC_0000001466594838__ol292726131116"><li id="EN-US_TOPIC_0000001466594838__li1592716651118"><span>Log in to the GaussDB(DWS) management console.</span></li><li id="EN-US_TOPIC_0000001466594838__li17928106191117"><span>Choose <span class="uicontrol" id="EN-US_TOPIC_0000001466594838__uicontrol10761253101213"><b>Clusters</b></span>. All clusters are displayed by default.</span></li><li id="EN-US_TOPIC_0000001466594838__li29284621110"><span>In the <span class="parmname" id="EN-US_TOPIC_0000001466594838__parmname1179618420718"><b>Operation</b></span> column of the target cluster, choose <strong id="EN-US_TOPIC_0000001466594838__b67964421176">More</strong> > <strong id="EN-US_TOPIC_0000001466594838__b97962420719">Scale Node</strong> > <strong id="EN-US_TOPIC_0000001466594838__b479710421716">Redistribute</strong>, as shown in the following figure.</span><p><p id="EN-US_TOPIC_0000001466594838__p1492896171110"><span><img id="EN-US_TOPIC_0000001466594838__image12454436101517" src="figure/en-us_image_0000001517355369.png" width="432.93601400000006" height="101.215261" title="Click to enlarge" class="imgResize"></span></p>
|
|
</p></li><li id="EN-US_TOPIC_0000001466594838__li0929561117"><span>On the <strong id="EN-US_TOPIC_0000001466594838__b1449221312812">Redistribute</strong> page that is displayed, set <strong id="EN-US_TOPIC_0000001466594838__b18492111342810">Advanced</strong> to <strong id="EN-US_TOPIC_0000001466594838__b0492111315280">Custom</strong>, set the redistribution mode to <strong id="EN-US_TOPIC_0000001466594838__b14492171362810">Online mode</strong>, and click <strong id="EN-US_TOPIC_0000001466594838__b10492151342815">Next: Confirm</strong> to submit the task.</span><p><p id="EN-US_TOPIC_0000001466594838__p169672177415"><span><img id="EN-US_TOPIC_0000001466594838__image28306226415" src="figure/en-us_image_0000001466754694.png" width="416.95500000000004" height="341.03022100000004" title="Click to enlarge" class="imgResize"></span></p>
|
|
<p id="EN-US_TOPIC_0000001466594838__p8929196191119"><span><img id="EN-US_TOPIC_0000001466594838__image1739119452439" src="figure/en-us_image_0000001518033857.png" width="412.96500000000003" height="138.079935" title="Click to enlarge" class="imgResize"></span></p>
|
|
</p></li></ol>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001466594838__section3137102712147"><a name="EN-US_TOPIC_0000001466594838__section3137102712147"></a><a name="section3137102712147"></a><h4 class="sectiontitle">Offline Scheduling</h4><p id="EN-US_TOPIC_0000001466594838__p385644063017"><strong id="EN-US_TOPIC_0000001466594838__b933114356413">Precautions</strong></p>
|
|
<p id="EN-US_TOPIC_0000001466594838__p191431416174418">Offline scheduling is similar to offline redistribution. In offline scheduling mode, tables are redistributed only within the configured time window, and redistribution is paused outside the time window.</p>
|
|
<div class="notice" id="EN-US_TOPIC_0000001466594838__note58411610184716"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-en-us.png"> </span><div class="noticebody"><ul id="EN-US_TOPIC_0000001466594838__ul1179258253"><li id="EN-US_TOPIC_0000001466594838__li1579185818519">Offline scheduling is supported only in <span id="EN-US_TOPIC_0000001466594838__ph1204622162413">8.1.3</span> or later.</li><li id="EN-US_TOPIC_0000001466594838__li480958158">If a cluster breaks down during redistribution, <strong id="EN-US_TOPIC_0000001466594838__b18321327194316">Redistribution failed</strong> will be displayed. If the cluster recovers, redistribution will automatically resume. To refresh the status, click <strong id="EN-US_TOPIC_0000001466594838__b1060917634511">Redistribute</strong> after the redistribution completes.</li></ul>
|
|
</div></div>
|
|
<p id="EN-US_TOPIC_0000001466594838__p063817240316"><strong id="EN-US_TOPIC_0000001466594838__b133321835134119">Procedure</strong></p>
|
|
<ol id="EN-US_TOPIC_0000001466594838__ol3674182433115"><li id="EN-US_TOPIC_0000001466594838__li2067252483117"><span>Log in to the GaussDB(DWS) management console.</span></li><li id="EN-US_TOPIC_0000001466594838__li13672152403114"><span>Click <span class="uicontrol" id="EN-US_TOPIC_0000001466594838__uicontrol133331235164110"><b>Clusters</b></span>. All clusters are displayed by default.</span></li><li id="EN-US_TOPIC_0000001466594838__li16741624113116"><span>In the <span class="parmname" id="EN-US_TOPIC_0000001466594838__parmname20778114816710"><b>Operation</b></span> column of the target cluster, choose <strong id="EN-US_TOPIC_0000001466594838__b18778114810710">More</strong> > <strong id="EN-US_TOPIC_0000001466594838__b137784481477">Scale Node</strong> > <strong id="EN-US_TOPIC_0000001466594838__b17779848077">Redistribute</strong>, as shown in the following figure.</span><p><p id="EN-US_TOPIC_0000001466594838__p4673172463112"></p>
|
|
<p id="EN-US_TOPIC_0000001466594838__p1285631873511"><span><img id="EN-US_TOPIC_0000001466594838__image20248019103513" src="figure/en-us_image_0000001517754401.png" width="422.871106" height="146.75725400000002" title="Click to enlarge" class="imgResize"></span></p>
|
|
</p></li><li id="EN-US_TOPIC_0000001466594838__li14674924193117"><span>On the <strong id="EN-US_TOPIC_0000001466594838__b329311919268">Redistribute</strong> page that is displayed, set <strong id="EN-US_TOPIC_0000001466594838__b19721340152711">Advanced</strong> to <strong id="EN-US_TOPIC_0000001466594838__b1994262417266">Custom</strong>, set the redistribution mode to <strong id="EN-US_TOPIC_0000001466594838__b1294223917261">Offline scheduling</strong> and configure the scheduling window, and click <strong id="EN-US_TOPIC_0000001466594838__b09341050202713">Next: Confirm</strong> to submit the task.</span><p><p id="EN-US_TOPIC_0000001466594838__p1054052053618"><span><img id="EN-US_TOPIC_0000001466594838__image826621123614" src="figure/en-us_image_0000001517913973.png" width="427.653254" height="211.189636" title="Click to enlarge" class="imgResize"></span></p>
|
|
<p id="EN-US_TOPIC_0000001466594838__p199721936133710"><span><img id="EN-US_TOPIC_0000001466594838__image14509133713710" src="figure/en-us_image_0000001517754397.png" width="431.78875600000003" height="212.187136" title="Click to enlarge" class="imgResize"></span></p>
|
|
<p id="EN-US_TOPIC_0000001466594838__p69167714425"><span><img id="EN-US_TOPIC_0000001466594838__image478019874218" src="figure/en-us_image_0000001518033869.png" width="436.90500000000003" height="146.08480600000001" title="Click to enlarge" class="imgResize"></span></p>
|
|
</p></li></ol>
|
|
<div class="note" id="EN-US_TOPIC_0000001466594838__note143861953012"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001466594838__p238615905">In scheduled redistribution mode and out of the scheduled time window, a redistribution task is paused and the cluster status is <strong id="EN-US_TOPIC_0000001466594838__b03995219818">Redistribution paused</strong>.</p>
|
|
</div></div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_01_0820.html">Cluster Redistribution</a></div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script language="JavaScript">
|
|
<!--
|
|
image_size('.imgResize');
|
|
var msg_imageMax = "view original image";
|
|
var msg_imageClose = "close";
|
|
//--></script> |