doc-exports/docs/css/umn/css_01_0093.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

39 lines
6.4 KiB
HTML

<a name="css_01_0093"></a><a name="css_01_0093"></a>
<h1 class="topictitle1">Creating and Managing Indices</h1>
<div id="body0000001334739209"><p id="css_01_0093__p95505610163">Clusters of versions 7.6.2 and 7.9.3 support index status management (ISM). ISM is a plugin that allows you to automate periodic and administrative operations based on changes on the index age, index size, or number of documents. When using the ISM plug-in, you can define policies that automatically handle index rolleovers or deletions based on your needs.</p>
<div class="note" id="css_01_0093__note822313154811"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="css_01_0093__p17221113124818">The following procedure uses Kibana 7.6.2 as an example. The Kibana UI varies depending on the Kibana version, but their operations are similar.</p>
</div></div>
<div class="section" id="css_01_0093__section779154094817"><h4 class="sectiontitle">Creating an Index Policy</h4><ol id="css_01_0093__ol1881418555550"><li id="css_01_0093__li18815455105512">Log in to Kibana and choose <strong id="css_01_0093__b9634124610193">IM</strong> or <strong id="css_01_0093__b38241057131913">Index Management</strong> on the left. The <strong id="css_01_0093__b072011974018">Index Management</strong> page is displayed.<div class="fignone" id="css_01_0093__fig1447493074011"><span class="figcap"><b>Figure 1 </b>Choosing IM</span><br><span><img id="css_01_0093__image1630162416013" src="en-us_image_0000001474566008.png"></span></div>
</li><li id="css_01_0093__li6804104711597">Click <strong id="css_01_0093__b1972915323208">Create policy</strong> to create an index policy.</li><li id="css_01_0093__li66234455115"><a name="css_01_0093__li66234455115"></a><a name="li66234455115"></a>Enter a policy ID in the <strong id="css_01_0093__b1925817592111">Policy ID</strong> text box and enter your policy in the <strong id="css_01_0093__b572101772117">Define policy</strong> text box.<div class="fignone" id="css_01_0093__fig11427149204015"><span class="figcap"><b>Figure 2 </b>Configuring a policy</span><br><span><img id="css_01_0093__image318610322918" src="en-us_image_0000001474246380.png"></span></div>
</li><li id="css_01_0093__li652213431799">Click <strong id="css_01_0093__b10356135519333">Create</strong>.<p id="css_01_0093__p19382202715116">After you create a policy, attach the policy to one or more indices. You can also include <strong id="css_01_0093__b5223758202316">policy_id</strong> in an index template, so when you create an index that matches the index template pattern, the policy is attached to the index.</p>
<p id="css_01_0093__p41700444314">For details about how to create an index template, see <a href="https://opendistro.github.io/for-elasticsearch-docs/docs/elasticsearch/index-templates/#create-template" target="_blank" rel="noopener noreferrer">Index Templates</a>.</p>
<pre class="screen" id="css_01_0093__screen1339616615129">PUT _template/&lt;template_name&gt;<strong id="css_01_0093__b1518219200134"> </strong>
{
"index_patterns": [
"index_name-*"
],
"settings": {
"opendistro.index_state_management.policy_id": "policy_id"
}
}</pre>
<ul id="css_01_0093__ul205914411053"><li id="css_01_0093__li859111412518"><em id="css_01_0093__i195052985813">&lt;template_name&gt;</em>: Replace it with the name of the created index template.</li><li id="css_01_0093__li158820217618"><em id="css_01_0093__i1722182117584">policy_id</em>: Replace it with the policy ID created in <a href="#css_01_0093__li66234455115">3</a>.</li></ul>
</li></ol>
</div>
<div class="section" id="css_01_0093__section11451321182815"><h4 class="sectiontitle">Attach the policy to an index.</h4><ol id="css_01_0093__ol157431012114419"><li id="css_01_0093__li147431512154414">Click <strong id="css_01_0093__b162348576256">Indices</strong>.<div class="fignone" id="css_01_0093__fig1194814714117"><span class="figcap"><b>Figure 3 </b>Choosing Indices</span><br><span><img id="css_01_0093__image8628141811453" src="en-us_image_0000001474406040.png"></span></div>
</li><li id="css_01_0093__li9472146174518">In the <strong id="css_01_0093__b12310153193010">Indices</strong> list, select the target index to which you want to attach the policy.</li><li id="css_01_0093__li177231867478">Click <strong id="css_01_0093__b4659330664225">Apply policy</strong> in the upper right corner.<div class="fignone" id="css_01_0093__fig02609262411"><span class="figcap"><b>Figure 4 </b>Adding a policy</span><br><span><img id="css_01_0093__image1225731525110" src="en-us_image_0000001524766301.png"></span></div>
</li><li id="css_01_0093__li7836174314115">Select the policy you created from the <strong id="css_01_0093__b1616122633210">Policy ID</strong> drop-down list.<div class="fignone" id="css_01_0093__fig2537324154211"><span class="figcap"><b>Figure 5 </b>Selecting a policy</span><br><span><img id="css_01_0093__image1219214421953" src="en-us_image_0000001525205869.png"></span></div>
</li><li id="css_01_0093__li943478933">Click <strong id="css_01_0093__b991611301244">Apply</strong>.<p id="css_01_0093__p648510212617">After you attach a policy to an index, ISM creates a job that runs every five minutes by default, to execute the policy, check conditions, and convert the index to different statuses.</p>
</li></ol>
</div>
<div class="section" id="css_01_0093__section87941257192"><h4 class="sectiontitle">Managing Indices</h4><ol id="css_01_0093__ol15110119124"><li id="css_01_0093__li4512211151214">Click <strong id="css_01_0093__b867302793819">Managed Indices</strong>.</li><li id="css_01_0093__li1770054817133">If you want to change the policy, click <strong id="css_01_0093__b11334114593813">Change policy</strong>. For details, see <a href="css_01_0092.html">Changing Policies</a>.</li><li id="css_01_0093__li189823731912">To delete a policy, select your policy, and click <strong id="css_01_0093__b1323102854017">Remove policy</strong>.</li><li id="css_01_0093__li78981237171911">To retry a policy, select your policy, and click <strong id="css_01_0093__b350914715419">Retry policy</strong>.</li></ol>
<p id="css_01_0093__p1509136183817">For details, see <a href="https://opendistro.github.io/for-elasticsearch-docs/docs/im/ism/" target="_blank" rel="noopener noreferrer">Index State Management</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="css_01_0091.html">Managing Index Statuses</a></div>
</div>
</div>