Files
doc-exports/docs/cce/umn/cce_bestpractice_10020.html
qiujiandong1 ab1e53a279 CCE UMN 20251031 version
Reviewed-by: Gergo-Bence Lorincz <a200452876@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-authored-by: qiujiandong1 <qiujiandong1@huawei.com>
Co-committed-by: qiujiandong1 <qiujiandong1@huawei.com>
2026-01-15 10:25:22 +00:00

26 lines
6.1 KiB
HTML

<a name="cce_bestpractice_10020"></a><a name="cce_bestpractice_10020"></a>
<h1 class="topictitle1">Executing the Pre- or Post-installation Commands During Node Creation</h1>
<div id="body8662426"><div class="section" id="cce_bestpractice_10020__cce_bestpractice_10020_0_section15188246201310"><h4 class="sectiontitle">Background</h4><p id="cce_bestpractice_10020__cce_bestpractice_10020_0_p18188587344">When creating a node, use the pre- or -installation commands to install tools or perform security hardening on the node. This section provides guidance for you to correctly use the pre- or post-installation scripts. </p>
</div>
<div class="section" id="cce_bestpractice_10020__cce_bestpractice_10020_0_section96603421411"><h4 class="sectiontitle">Precautions</h4><ul id="cce_bestpractice_10020__cce_bestpractice_10020_0_ul637602461419"><li id="cce_bestpractice_10020__cce_bestpractice_10020_0_li437792421413">Do not use pre- or post-installation scripts that take a long time to execute.<p id="cce_bestpractice_10020__cce_bestpractice_10020_0_p132751016151413"><a name="cce_bestpractice_10020__cce_bestpractice_10020_0_li437792421413"></a><a name="cce_bestpractice_10020_0_li437792421413"></a>The pre-installation script has a 15-minute time limit, while the post-installation script has a 30-minute time limit. If the node is not available within the designated time, the node reclaim process will be initiated. Therefore, do not use pre- or post-installation scripts that take a long time to execute.</p>
</li><li id="cce_bestpractice_10020__cce_bestpractice_10020_0_li20533930201418">Do not directly use <strong id="cce_bestpractice_10020__cce_bestpractice_10020_0_b1050960151417">reboot</strong> in the script.<p id="cce_bestpractice_10020__cce_bestpractice_10020_0_p02751116201419">CCE executes the post-installation command after installing mandatory components on a node. The node will be available only after the post-installation command is executed. If you run <strong id="cce_bestpractice_10020__cce_bestpractice_10020_0_b578533219147">reboot</strong> directly, the node may be restarted before its status is reported. As a result, it cannot reach the running state within 30 minutes, and a rollback due to timeout will be triggered. Therefore, do not use <strong id="cce_bestpractice_10020__cce_bestpractice_10020_0_b023253181514">reboot</strong>.</p>
<p id="cce_bestpractice_10020__cce_bestpractice_10020_0_p627551612142">If you need to restart a node, perform the following operations:</p>
<ul id="cce_bestpractice_10020__cce_bestpractice_10020_0_ul9275171613142"><li id="cce_bestpractice_10020__cce_bestpractice_10020_0_li12757161149">Run <strong id="cce_bestpractice_10020__cce_bestpractice_10020_0_b3882112141519">shutdown -r</strong> <em id="cce_bestpractice_10020__cce_bestpractice_10020_0_i498415258158">&lt;time &gt;</em> in the script to delay the restart. For example, you can run <strong id="cce_bestpractice_10020__cce_bestpractice_10020_0_b1471337121514">shutdown -r 1</strong> to delay the restart for 1 minute.</li><li id="cce_bestpractice_10020__cce_bestpractice_10020_0_li22750167149">After the node is available, manually restart it.</li></ul>
</li></ul>
</div>
<div class="section" id="cce_bestpractice_10020__cce_bestpractice_10020_0_section670983681419"><h4 class="sectiontitle">Procedure</h4><ol id="cce_bestpractice_10020__cce_bestpractice_10020_0_ol17571357161417"><li id="cce_bestpractice_10020__cce_bestpractice_10020_0_li1353715161746"><span>Log in to the <span id="cce_bestpractice_10020__cce_bestpractice_10020_0_ph1378912461749">CCE console</span>. In the navigation pane, choose <strong id="cce_bestpractice_10020__cce_bestpractice_10020_0_b71863434951647">Clusters</strong>. Click the target cluster name to access the cluster console.</span></li><li id="cce_bestpractice_10020__cce_bestpractice_10020_0_li178653514531"><span>Choose <strong id="cce_bestpractice_10020__cce_bestpractice_10020_0_b35307018173">Nodes</strong> in the navigation pane, click the <strong id="cce_bestpractice_10020__cce_bestpractice_10020_0_b5564541145219">Nodes</strong> tab, click <strong id="cce_bestpractice_10020__cce_bestpractice_10020_0_b48809691713">Create Node</strong> in the right corner, and configure the parameters.</span></li><li id="cce_bestpractice_10020__cce_bestpractice_10020_0_li107367323414"><span>In the <strong id="cce_bestpractice_10020__cce_bestpractice_10020_0_b828964516177">Advanced Settings</strong> area, enter pre- or post-installation commands.</span><p><p id="cce_bestpractice_10020__cce_bestpractice_10020_0_p134111657195916"><span><img id="cce_bestpractice_10020__cce_bestpractice_10020_0_image1081611819514" src="en-us_image_0000002484118386.png"></span></p>
<p id="cce_bestpractice_10020__cce_bestpractice_10020_0_p10879174413419">For example, you can create iptables rules by running a post-installation command to allow a maximum of 25 TCP data packets to be addressed to port 80 per minute and allow a maximum of 100 data packets to be addressed to the port when the limit is exceeded to prevent DDoS attacks.</p>
<pre class="screen" id="cce_bestpractice_10020__cce_bestpractice_10020_0_screen3623182719377">iptables -A INPUT -p tcp --dport 80 -m limit --limit 25/minute --limit-burst 100 -j ACCEPT</pre>
<div class="note" id="cce_bestpractice_10020__cce_bestpractice_10020_0_note1857443913713"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="cce_bestpractice_10020__cce_bestpractice_10020_0_p057519395376">The command example here is for reference only.</p>
</div></div>
</p></li><li id="cce_bestpractice_10020__cce_bestpractice_10020_0_li056614484375"><span>After the configuration, enter the number of nodes to be created and click <strong id="cce_bestpractice_10020__cce_bestpractice_10020_0_b19983126706">Next: Confirm</strong>.</span></li><li id="cce_bestpractice_10020__cce_bestpractice_10020_0_li696764914381"><span>Click <strong id="cce_bestpractice_10020__cce_bestpractice_10020_0_b149773270051647">Submit</strong>.</span></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="cce_10_0704.html">Node O&amp;M</a></div>
</div>
</div>