forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: zhengxiu <zhengxiu@huawei.com> Co-committed-by: zhengxiu <zhengxiu@huawei.com>
134 lines
14 KiB
HTML
134 lines
14 KiB
HTML
<a name="EN-US_TOPIC_0000001965497097"></a><a name="EN-US_TOPIC_0000001965497097"></a>
|
|
|
|
<h1 class="topictitle1">Configuring an Index Recycle Bin for an Elasticsearch Cluster</h1>
|
|
<div id="body0000001951245585"><p id="EN-US_TOPIC_0000001965497097__p1437394813413">With Elasticsearch clusters, indexes are deleted without first being put into a recycle bin. To allow users to restore data after misdeletion, CSS provides an index recycle bin. Similar to other recycle bins, the index recycle bin temporarily stores deleted indexes so that users can restore them before they are finally removed from the recycle bin. This helps to improve cluster data reliability.</p>
|
|
<div class="section" id="EN-US_TOPIC_0000001965497097__section9897287266"><h4 class="sectiontitle">Constraints</h4><ul id="EN-US_TOPIC_0000001965497097__ul96081153594"><li id="EN-US_TOPIC_0000001965497097__li5608135319911">Only Elasticsearch 7.10.2 clusters support the index recycle bin.</li></ul>
|
|
<ul id="EN-US_TOPIC_0000001965497097__ul13857135016269"><li id="EN-US_TOPIC_0000001965497097__li18857550192619">With the index recycle bin enabled, after you use the DELETE API to move an index to the recycle bin, the cluster status may stay RED for a short period of time. This is because putting the index into the recycle bin causes the index to be closed, and the Elasticsearch cluster status becomes RED when there are closed indexes.</li><li id="EN-US_TOPIC_0000001965497097__li84391453124220">When a restoration API is used to restore an index from the recycle bin, the cluster status may also stay RED for a short period of time. This is because restoring an index from the recycle bin causes that index to be reopened, and when it happens, Elasticsearch needs to re-initialize shards. This causes the cluster status to become RED momentarily.</li><li id="EN-US_TOPIC_0000001965497097__li1857450122615">Indexes stored in the recycle bin are still part of the cluster metadata. Before they are removed from the recycle bin, same-name indexes cannot be created for the cluster.</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001965497097__section174503513432"><h4 class="sectiontitle">Enabling the Index Recycle Bin</h4><p id="EN-US_TOPIC_0000001965497097__p151341657192511">Run the following command to enable the index recycle bin:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001965497097__screen6814124417234">PUT _cluster/settings
|
|
{
|
|
"persistent": {
|
|
<strong id="EN-US_TOPIC_0000001965497097__b185201229175110">"index.trash.enabled": true</strong>
|
|
}
|
|
}</pre>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001965497097__table65681030176" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Configuration items</caption><thead align="left"><tr id="EN-US_TOPIC_0000001965497097__row1556818313175"><th align="left" class="cellrowborder" valign="top" width="30%" id="mcps1.3.3.4.2.3.1.1"><p id="EN-US_TOPIC_0000001965497097__p45686391712">Configuration Item</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="70%" id="mcps1.3.3.4.2.3.1.2"><p id="EN-US_TOPIC_0000001965497097__p156811351711">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001965497097__row1456833141714"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.3.4.2.3.1.1 "><p id="EN-US_TOPIC_0000001965497097__p956812321718"><span class="parmname" id="EN-US_TOPIC_0000001965497097__parmname769318297172"><b>index.trash.enabled</b></span></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.3.4.2.3.1.2 "><p id="EN-US_TOPIC_0000001965497097__p5568732175">Whether to enable the index recycle bin. The default value is <strong id="EN-US_TOPIC_0000001965497097__b11596450601">false</strong>. This setting is compatible with the open-source Elasticsearch. Setting this parameter to <strong id="EN-US_TOPIC_0000001965497097__b73722431019">true</strong> enables the index recycle bin. After an index is deleted, the index is stored in the recycle bin. You need to delete the index again to permanently delete the index data.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001965497097__row145687331717"><td class="cellrowborder" valign="top" width="30%" headers="mcps1.3.3.4.2.3.1.1 "><p id="EN-US_TOPIC_0000001965497097__p95686319177"><span class="parmname" id="EN-US_TOPIC_0000001965497097__parmname196575587176"><b>indices.trash.keep.time</b></span></p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="70%" headers="mcps1.3.3.4.2.3.1.2 "><p id="EN-US_TOPIC_0000001965497097__p15568835174">Duration for retaining indexes in the recycle bin. The default value is <strong id="EN-US_TOPIC_0000001965497097__b159727564217">1d</strong>, meaning indexes will be retained in the recycle bin for one day before they are permanently deleted. The minimum value is <strong id="EN-US_TOPIC_0000001965497097__b3134233132">1d</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="note" id="EN-US_TOPIC_0000001965497097__note68481929804"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><div class="p" id="EN-US_TOPIC_0000001965497097__p1984014020520">The following command deletes an index:<pre class="screen" id="EN-US_TOPIC_0000001965497097__screen79041327115720">DELETE <em id="EN-US_TOPIC_0000001965497097__i057313455583">{INDEX_NAME}</em></pre>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001965497097__p17605123961419"><strong id="EN-US_TOPIC_0000001965497097__b69966592313">INDEX_NAME</strong> indicates the name of the index to be deleted. Wildcards can be used to specify indexes.</p>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001965497097__section61032015567"><h4 class="sectiontitle">Viewing Indexes in the Recycle Bin</h4><p id="EN-US_TOPIC_0000001965497097__p784152117249">Run the following command to view indexes in the index recycle bin:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001965497097__screen109418338271">GET _cat/trash?<em id="EN-US_TOPIC_0000001965497097__i154461247673">v=true&s=index</em></pre>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001965497097__table843716448299" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000001965497097__row743744412911"><th align="left" class="cellrowborder" valign="top" width="18.77%" id="mcps1.3.4.4.2.3.1.1"><p id="EN-US_TOPIC_0000001965497097__p7437124413296">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="81.23%" id="mcps1.3.4.4.2.3.1.2"><p id="EN-US_TOPIC_0000001965497097__p6437644132915">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001965497097__row1143713444296"><td class="cellrowborder" valign="top" width="18.77%" headers="mcps1.3.4.4.2.3.1.1 "><p id="EN-US_TOPIC_0000001965497097__p1943716447292">v</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="81.23%" headers="mcps1.3.4.4.2.3.1.2 "><p id="EN-US_TOPIC_0000001965497097__p15437194410299">Whether to display the table header when the return format is a table.</p>
|
|
<ul id="EN-US_TOPIC_0000001965497097__ul76349221383"><li id="EN-US_TOPIC_0000001965497097__li4635152215813">true: display the table header.</li><li id="EN-US_TOPIC_0000001965497097__li96351322188">false: not display the table header.</li></ul>
|
|
<p id="EN-US_TOPIC_0000001965497097__p21648290813">The default value is <strong id="EN-US_TOPIC_0000001965497097__b119441759288">false</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001965497097__row1343774402915"><td class="cellrowborder" valign="top" width="18.77%" headers="mcps1.3.4.4.2.3.1.1 "><p id="EN-US_TOPIC_0000001965497097__p1043734410297">s</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="81.23%" headers="mcps1.3.4.4.2.3.1.2 "><p id="EN-US_TOPIC_0000001965497097__p14437744182914">Index sorting fields. Options include <span class="parmname" id="EN-US_TOPIC_0000001965497097__parmname182661950111010"><b>index</b></span>, <span class="parmname" id="EN-US_TOPIC_0000001965497097__parmname13343852191010"><b>uuid</b></span>, <span class="parmname" id="EN-US_TOPIC_0000001965497097__parmname193920548109"><b>pri</b></span>, <span class="parmname" id="EN-US_TOPIC_0000001965497097__parmname397312560101"><b>rep</b></span>, <span class="parmname" id="EN-US_TOPIC_0000001965497097__parmname1214735911109"><b>trash.ts</b></span>, and <span class="parmname" id="EN-US_TOPIC_0000001965497097__parmname10484151161111"><b>delete.time</b></span>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001965497097__row144371344112913"><td class="cellrowborder" valign="top" width="18.77%" headers="mcps1.3.4.4.2.3.1.1 "><p id="EN-US_TOPIC_0000001965497097__p1543734482918">format</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="81.23%" headers="mcps1.3.4.4.2.3.1.2 "><p id="EN-US_TOPIC_0000001965497097__p3438544102918">Return format of the command. The default format is table. Other options include json, yaml, cobr, and smile. cobr and smile are binary formats.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001965497097__row643824410293"><td class="cellrowborder" valign="top" width="18.77%" headers="mcps1.3.4.4.2.3.1.1 "><p id="EN-US_TOPIC_0000001965497097__p7438114422916">h</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="81.23%" headers="mcps1.3.4.4.2.3.1.2 "><p id="EN-US_TOPIC_0000001965497097__p172071235111117">Set the column names to be displayed. By default, all column names are displayed. To specify the column names you want to display, separate them using commas (,), for example, <strong id="EN-US_TOPIC_0000001965497097__b12550429237">h=index,uuid,delete.time</strong>.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001965497097__p4730102482716">The following is an example of the output.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001965497097__screen9561132172814">index uuid pri rep trash.ts delete.time
|
|
index1 CMD3FCLzTOyTg4RUekWNNA 1 1 1714465116615 23.6h
|
|
index1 6ATijuu6SfqamVI-WMyOKg 1 1 1714466233898 23.9h</pre>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001965497097__table1616611511307" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Parameters in the output</caption><thead align="left"><tr id="EN-US_TOPIC_0000001965497097__row1819485113308"><th align="left" class="cellrowborder" valign="top" width="12.55%" id="mcps1.3.4.7.2.3.1.1"><p id="EN-US_TOPIC_0000001965497097__p14194145113016">Column</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="87.45%" id="mcps1.3.4.7.2.3.1.2"><p id="EN-US_TOPIC_0000001965497097__p21941517305">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0000001965497097__row111941351163013"><td class="cellrowborder" valign="top" width="12.55%" headers="mcps1.3.4.7.2.3.1.1 "><p id="EN-US_TOPIC_0000001965497097__p919418511307">index</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="87.45%" headers="mcps1.3.4.7.2.3.1.2 "><p id="EN-US_TOPIC_0000001965497097__p719419513304">Index name</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001965497097__row1919425103015"><td class="cellrowborder" valign="top" width="12.55%" headers="mcps1.3.4.7.2.3.1.1 "><p id="EN-US_TOPIC_0000001965497097__p619465113015">uuid</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="87.45%" headers="mcps1.3.4.7.2.3.1.2 "><p id="EN-US_TOPIC_0000001965497097__p21945516301">Index UUID</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001965497097__row1194105116306"><td class="cellrowborder" valign="top" width="12.55%" headers="mcps1.3.4.7.2.3.1.1 "><p id="EN-US_TOPIC_0000001965497097__p119475123015">pri</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="87.45%" headers="mcps1.3.4.7.2.3.1.2 "><p id="EN-US_TOPIC_0000001965497097__p10194451183015">Number of shards of an index</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001965497097__row51943513304"><td class="cellrowborder" valign="top" width="12.55%" headers="mcps1.3.4.7.2.3.1.1 "><p id="EN-US_TOPIC_0000001965497097__p10194125143018">rep</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="87.45%" headers="mcps1.3.4.7.2.3.1.2 "><p id="EN-US_TOPIC_0000001965497097__p41944511301">Number of replicas of an index</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001965497097__row3194751103017"><td class="cellrowborder" valign="top" width="12.55%" headers="mcps1.3.4.7.2.3.1.1 "><p id="EN-US_TOPIC_0000001965497097__p14194125133016">trash.ts</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="87.45%" headers="mcps1.3.4.7.2.3.1.2 "><p id="EN-US_TOPIC_0000001965497097__p6195351193017">Time when an index was moved to the recycle bin</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0000001965497097__row1819514519303"><td class="cellrowborder" valign="top" width="12.55%" headers="mcps1.3.4.7.2.3.1.1 "><p id="EN-US_TOPIC_0000001965497097__p20195195133018">delete.time</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="87.45%" headers="mcps1.3.4.7.2.3.1.2 "><p id="EN-US_TOPIC_0000001965497097__p5195951193017">Remaining retention duration of an index in the recycle bin. When the value changes to 0, the index is permanently deleted.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001965497097__section142171239125919"><h4 class="sectiontitle">Restoring an Index from the Recycle Bin</h4><p id="EN-US_TOPIC_0000001965497097__p82761334152713">Run the following command to restore an index from the recycle bin:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001965497097__screen1436213293212">POST /trash/recover/<em id="EN-US_TOPIC_0000001965497097__i128588493133">{INDEX_NAME}</em></pre>
|
|
<p id="EN-US_TOPIC_0000001965497097__p17194819203219"><strong id="EN-US_TOPIC_0000001965497097__b79661939162711">INDEX_NAME</strong> indicates the name of the index to be restored. Wildcards can be used to specify indexes.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001965497097__section2255174216155"><h4 class="sectiontitle">Emptying the Recycle Bin</h4><p id="EN-US_TOPIC_0000001965497097__p1254465081512">Run the following command to clear the recycle bin:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001965497097__screen67851312111615">POST trash/empty</pre>
|
|
<p id="EN-US_TOPIC_0000001965497097__p14666193311617">Emptying the recycle bin will permanently delete all data in it. Please exercise caution.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="css_01_0111.html">Enhancing Search Capabilities for Elasticsearch Clusters</a></div>
|
|
</div>
|
|
</div>
|
|
|