doc-exports/docs/dws/umn/dws_01_0821.html
Lu, Huayi 95132e24fc DWS UMN 830.201_new version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Reviewed-by: Rechenburg, Matthias <matthias.rechenburg@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-27 11:54:34 +00:00

37 lines
13 KiB
HTML

<a name="EN-US_TOPIC_0000001707293857"></a><a name="EN-US_TOPIC_0000001707293857"></a>
<h1 class="topictitle1">Scaling In a Cluster</h1>
<div id="body8662426"><p id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_p8290718113316">You can scale in your clusters on the console to release unnecessary computing and storage resources provided by GaussDB(DWS).</p>
<div class="section" id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_section13554122617360"><h4 class="sectiontitle">Impact on the System</h4><ul id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_ul2259114513617"><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li1178249327">Before the scale-in, exit the client connections that have created temporary tables, because temporary tables created before or during the scale-in will become invalid and operations performed on these temporary tables will fail. Temporary tables created after the scale-in will not be affected.</li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li34569524214">If you start a scale-in, an automatic snapshot will be created for the cluster before scale-in. If you do not need the snapshot, you can disable the automated backup function on the scale-in page.</li><li id="EN-US_TOPIC_0000001707293857__li1477733613566">Before scale-in, ensure that the skew rate does not exceed 10%. There is no general requirement for the dirty page rate. However, for a large table whose size is greater than 50 GB, ensure that the dirty page rate does not exceed 20% to 30%.</li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li1675651513517">In a cluster that is being scaled in, the following functions are disabled: cluster restart, cluster scale-out, snapshot creation, node management, intelligent O&amp;M, resource management, parameter modification, security configurations, log service, database administrator password resetting, and cluster deletion.</li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li12497635141010">During offline scale-in, stop all services or run only a few query statements. 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. After a table is redistributed, you can access the table. During redistribution, avoid querying data for more than 20 minutes. The default time for applying a write lock during redistribution is 20 minutes. Exceeding this duration may lead to redistribution failure due to lock waiting timeout.</li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li181411635132515">During online scale-in, you can perform insert, update, and delete operations on tables, but data updates may still be blocked for a short period of time. Redistribution consumes lots of CPU and I/O resources, which will greatly impact job performance. Therefore, perform redistribution when services are stopped or during periods of light load.</li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li326352583017">During offline scale-in, if a node is deleted while DDL statements are executed (to create a schema or function), these statements may report errors, because the DN cannot be found. In this case, you simply need to retry the statements.</li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li0260104513362">If a cluster scale-in fails, the database does not automatically roll back the scale-in operation, and no O&amp;M operations can be performed. In this case, you need to click the <strong id="EN-US_TOPIC_0000001707293857__b2090972995812">Scale In</strong> on the console to try again.</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_section2621350104513"><h4 class="sectiontitle">Prerequisites</h4><ul id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_ul1561515357474"><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li116153352476">The cluster is in <strong id="EN-US_TOPIC_0000001707293857__b6617455239159">Available</strong> state, is not read-only, and there is no data being redistributed in the cluster.</li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li146161635204718">A cluster configuration file has been generated, and configuration information is consistent with the current cluster configuration.</li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li7616133512479">Before the scale-in operation starts, the value of <strong id="EN-US_TOPIC_0000001707293857__b372853939159">default_storage_nodegroup</strong> is <strong id="EN-US_TOPIC_0000001707293857__b7693823079159">installation</strong>.</li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li561623594713">The cluster is configured in the ring mode. A ring is the smallest unit for scale-in. Four or five hosts form a ring. The primary, standby, and secondary DNs are deployed in this ring. </li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li361616354471">The scale-in host does not contain the GTM, ETCD, or CM Server component.</li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li561623510473">There are no CNs on the nodes to be scaled in.</li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li5616173524714">Scale-in does not support rollback but supports retry. A data redistribution failure after a scale-in does not affect services. You can complete scale-in at other appropriate time. Otherwise, unbalanced data distribution will persist for a long time.</li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li161723584718">Before redistribution, ensure that the <strong id="EN-US_TOPIC_0000001707293857__b8642813159159">data_redis</strong> schema in the corresponding database is reserved for redistribution and that no user operation on it or its tables is allowed. During redistribution, <strong id="EN-US_TOPIC_0000001707293857__b1770761482718">data_redis</strong> is used. After the operation is complete, the schema will be deleted. User tables (if any) in the schema will also be deleted.</li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li176172353478"><strong id="EN-US_TOPIC_0000001707293857__b5981681089159">gs_cgroup</strong> cannot be used during scale-in.</li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li1861743511471">Before the scale-in, check the remaining capacity of the cluster. The nodes remaining in a scale-in must have sufficient space to store the data of the entire cluster. Otherwise, the scale-in cannot be properly performed.<ul id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_ul537415376614"><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li183748371963">The used physical disk space on each node is less than 80%.</li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li63741537765">All the users and roles use less than 80% of resource quota in total.</li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li9374113718615">The estimated space usage after scale-in must be less than 80%.</li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li27508231757">The available space is 1.5 times larger than the maximum size of a single table.<div class="note" id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_note774013231350"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_p174421961967">To check the maximum size of a single table, use the following inspection tool:</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_screen643554615517"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">gs_check</span><span class="w"> </span><span class="o">-</span><span class="n">i</span><span class="w"> </span><span class="n">CheckBiggestTable</span><span class="w"> </span><span class="o">-</span><span class="n">L</span>
</pre></div></td></tr></table></div>
</div>
</div></div>
</li></ul>
</li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li7617163510471">Automatic removal of faulty CNs is disabled during the scale-in and is enabled after the scale-in is complete.</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_section17438181076"><h4 class="sectiontitle">Procedure</h4><ol id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_ol20794165110719"><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li679412511071"><span>Log in to the GaussDB(DWS) management console.</span></li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li19319401811"><span>Choose <strong id="EN-US_TOPIC_0000001707293857__b1033463610582">Clusters</strong> &gt; <strong id="EN-US_TOPIC_0000001707293857__b7334113635816">Dedicated Clusters</strong>.</span></li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li32115210112"><span>In the <span class="parmname" id="EN-US_TOPIC_0000001707293857__parmname13319191482"><b>Operation</b></span> column of the target cluster, choose <strong id="EN-US_TOPIC_0000001707293857__b103115191985">More</strong> &gt; <strong id="EN-US_TOPIC_0000001707293857__b163131920815">Scale Node</strong> &gt; <strong id="EN-US_TOPIC_0000001707293857__b18329197814">Scale In</strong>.</span><p><p id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_p58121550117"><span><img id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_image1335353514416" src="figure/en-us_image_0000001711598592.png" title="Click to enlarge" class="imgResize"></span></p>
</p></li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li16819124951110"><span>The scale-in page is displayed. You can select the number of nodes to be scaled in. The automated backup function is enabled by default.</span><p><p id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_p469875213112"><span><img id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_image1069692112816" src="figure/en-us_image_0000001759517989.png" title="Click to enlarge" class="imgResize"></span></p>
</p></li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li3558015145720"><span>Click <strong id="EN-US_TOPIC_0000001707293857__b6500171311290">Next: Confirm</strong>. The system will check the cluster status before scale-in. If your cluster fails the check, an error message will be displayed.</span><p><p id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_p1345716131195"><span><img id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_image2063292910589" src="figure/en-us_image_0000001711439104.png" title="Click to enlarge" class="imgResize"></span></p>
</p></li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li1181424121514"><span>After the check is passed, click <strong id="EN-US_TOPIC_0000001707293857__b33841826183016">Confirm</strong> to return to the cluster list. The cluster status is <strong id="EN-US_TOPIC_0000001707293857__b1817429103016">Scaling in</strong>. Wait for a while.</span><p><p id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_p18984132601510"><span><img id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_image17241516111513" src="figure/en-us_image_0000001759358129.png" title="Click to enlarge" class="imgResize"></span></p>
</p></li></ol>
<div class="note" id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_note178500566163"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_ul18850175616169"><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li1385095612164">If the cluster parameters fail the check, the scale-in will fail. To avoid this problem, ensure your parameter settings are correct.</li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li3850185601610">If schemas fail the check, the scale-in will fail. To avoid this problem, check whether any schema that conflicts with the scale-in exists.</li><li id="EN-US_TOPIC_0000001707293857__en-us_topic_0000001372679742_li1385075681611">If the disk space fails the check, the scale-in may fail or the cluster may become read-only after the scale-in. To avoid this problem, increase your cluster disk capacity.</li></ul>
</div></div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_01_0910.html">Scaling Nodes</a></div>
</div>
</div>
<script language="JavaScript">
<!--
image_size('.imgResize');
var msg_imageMax = "view original image";
var msg_imageClose = "close";
//--></script>