doc-exports/docs/css/umn/css_02_0119.html
Zheng, Xiu 5b5876528a CSS UMN 22.5.1 Version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Zheng, Xiu <zhengxiu@huawei.com>
Co-committed-by: Zheng, Xiu <zhengxiu@huawei.com>
2023-03-29 17:17:49 +00:00

30 lines
3.2 KiB
HTML

<a name="css_02_0119"></a><a name="css_02_0119"></a>
<h1 class="topictitle1">How Do I Update the CSS Lifecycle Policy?</h1>
<div id="body0000001196783294"><p id="css_02_0119__p8060118">The CSS lifecycle 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="css_02_0119__ol7971119725"><li id="css_02_0119__li79721913217">When a policy is created, the system writes a record to the <strong id="css_02_0119__b10983164344012">.opendistro-ism-config</strong> index. In the record, <strong id="css_02_0119__b179151741184116">_id</strong> is the policy name, and the content is the policy definition.<div class="fignone" id="css_02_0119__fig14959183904114"><span class="figcap"><b>Figure 1 </b>Writing a data record</span><br><span><img id="css_02_0119__image53129442217" src="en-us_image_0000001476977566.png"></span></div>
</li><li id="css_02_0119__li1289612012213">After a policy is bound to an index, the system writes another record to the <strong id="css_02_0119__b98061017433">.opendistro-ism-config</strong> index. The following figure shows the initial status of a record.<div class="fignone" id="css_02_0119__fig16780058114117"><span class="figcap"><b>Figure 2 </b>Initial data status</span><br><span><img id="css_02_0119__image188057614207" src="en-us_image_0000001527777453.png"></span></div>
</li><li id="css_02_0119__li14313105105618">Run the <strong id="css_02_0119__b2792105210498">explain</strong> command. Only a policy ID will be returned.<pre class="screen" id="css_02_0119__screen2321551105616">GET _opendistro/_ism/explain/data2
{
"data2" : {
"index.opendistro.index_state_management.policy_id" : "policy1"
}
}</pre>
<p id="css_02_0119__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="css_02_0119__fig15321155115616"><span class="figcap"><b>Figure 3 </b>Initialized data</span><br><span><img id="css_02_0119__image16321051135613" src="en-us_image_0000001477297366.png"></span></div>
<p id="css_02_0119__p832117519564">After the initialization, <strong id="css_02_0119__b16910549155012">min_index_age</strong> in the policy will be copied.</p>
<div class="note" id="css_02_0119__note3321551155616"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="css_02_0119__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="css_02_0119__ol794133262717"><li id="css_02_0119__li1794193211278">After the policy is modified, call the <strong id="css_02_0119__b175012558131">change_policy</strong> API to update the policy.<pre class="screen" id="css_02_0119__screen15455155621917">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">Functions</a></div>
</div>
</div>