Files
doc-exports/docs/css/umn/css_02_0119.html
zhengxiu 93d856d5c5 css umn 25.6.0 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: zhengxiu <zhengxiu@huawei.com>
Co-committed-by: zhengxiu <zhengxiu@huawei.com>
2025-11-25 11:34:43 +00:00

30 lines
3.9 KiB
HTML

<a name="EN-US_TOPIC_0000001933159118"></a><a name="EN-US_TOPIC_0000001933159118"></a>
<h1 class="topictitle1">How Do I Update Index Lifecycle Policies for an Elasticsearch Cluster of CSS?</h1>
<div id="body0000001196783294"><p id="EN-US_TOPIC_0000001933159118__p8060118">The lifecycle of Elasticsearch clusters is implemented using the Index State Management (ISM) of Open Distro. For details about how to configure policies related to the ISM template, see the <a href="https://opendistro.github.io/for-elasticsearch-docs/docs/im/ism/" target="_blank" rel="noopener noreferrer">Open Distro documentation</a>.</p>
<ol id="EN-US_TOPIC_0000001933159118__ol7971119725"><li id="EN-US_TOPIC_0000001933159118__li79721913217">When a policy is created, the system writes a record to the <span class="parmname" id="EN-US_TOPIC_0000001933159118__parmname937563612012"><b>.opendistro-ism-config</b></span> index. In the record, <span class="parmname" id="EN-US_TOPIC_0000001933159118__parmname1517185944017"><b>_id</b></span> is the policy name, and the content is the policy definition.<div class="fignone" id="EN-US_TOPIC_0000001933159118__fig14959183904114"><span class="figcap"><b>Figure 1 </b>Writing a data record</span><br><span><img id="EN-US_TOPIC_0000001933159118__image53129442217" src="figure/en-us_image_0000001960397693.png"></span></div>
</li><li id="EN-US_TOPIC_0000001933159118__li1289612012213">After a policy is bound to an index, the system writes another record to the <span class="parmname" id="EN-US_TOPIC_0000001933159118__parmname7299202213010"><b>.opendistro-ism-config</b></span> index. The following figure shows the initial status of a record.<div class="fignone" id="EN-US_TOPIC_0000001933159118__fig16780058114117"><span class="figcap"><b>Figure 2 </b>Initial data status</span><br><span><img id="EN-US_TOPIC_0000001933159118__image188057614207" src="figure/en-us_image_0000001933159210.png"></span></div>
</li><li id="EN-US_TOPIC_0000001933159118__li14313105105618">Run the <strong id="EN-US_TOPIC_0000001933159118__b2792105210498">explain</strong> command. Only a policy ID will be returned.<pre class="screen" id="EN-US_TOPIC_0000001933159118__screen2321551105616">GET _opendistro/_ism/explain/data2
{
"data2" : {
"index.opendistro.index_state_management.policy_id" : "policy1"
}
}</pre>
<p id="EN-US_TOPIC_0000001933159118__p8321175165614">Open Distro will execute an initialization process to fill the policy content in the record. The following figure shows the initialized data.</p>
<div class="fignone" id="EN-US_TOPIC_0000001933159118__fig15321155115616"><span class="figcap"><b>Figure 3 </b>Initialized data</span><br><span><img id="EN-US_TOPIC_0000001933159118__image16321051135613" src="figure/en-us_image_0000001933318578.png"></span></div>
<p id="EN-US_TOPIC_0000001933159118__p832117519564">After the initialization, <strong id="EN-US_TOPIC_0000001933159118__b16910549155012">min_index_age</strong> in the policy will be copied.</p>
<div class="note" id="EN-US_TOPIC_0000001933159118__note3321551155616"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001933159118__p13211651125612">The initialized index uses a copy of this policy. The policy update will not take effect on the index.</p>
</div></div>
</li></ol><ol start="4" id="EN-US_TOPIC_0000001933159118__ol794133262717"><li id="EN-US_TOPIC_0000001933159118__li1794193211278">After the policy is modified, call the <strong id="EN-US_TOPIC_0000001933159118__b175012558131">change_policy</strong> API to update the policy.<pre class="screen" id="EN-US_TOPIC_0000001933159118__screen13164135174319">POST _opendistro/_ism/change_policy/data1
{
"policy_id": "policy1"
}</pre>
</li></ol>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="css_02_0055.html">Using CSS Cluster Search Engines</a></div>
</div>
</div>