forked from docs/doc-exports
Reviewed-by: Kacur, Michal <michal.kacur@t-systems.com> Co-authored-by: Wuwan, Qi <wuwanqi1@noreply.gitea.eco.tsi-dev.otc-service.com> Co-committed-by: Wuwan, Qi <wuwanqi1@noreply.gitea.eco.tsi-dev.otc-service.com>
38 lines
8.7 KiB
HTML
38 lines
8.7 KiB
HTML
<a name="css_01_0093"></a><a name="css_01_0093"></a>
|
|
|
|
<h1 class="topictitle1">Creating and Managing Indexes</h1>
|
|
<div id="body1606731388435"><p id="css_01_0093__en-us_topic_0000001268154473_p95505610163">Clusters of version 7.6.2 or later support index status management. 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 rollovers or deletions based on your needs.</p>
|
|
<div class="note" id="css_01_0093__en-us_topic_0000001268154473_note822313154811"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="css_01_0093__en-us_topic_0000001268154473_p17221113124818">The following procedure uses Elasticsearch 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__en-us_topic_0000001268154473_section779154094817"><h4 class="sectiontitle">Creating an Index Policy</h4><ol id="css_01_0093__en-us_topic_0000001268154473_ol1881418555550"><li id="css_01_0093__en-us_topic_0000001268154473_li18815455105512">Log in to Kibana and choose <strong id="css_01_0093__en-us_topic_0000001268154473_b9634124610193">IM</strong> or <strong id="css_01_0093__en-us_topic_0000001268154473_b38241057131913">Index Management</strong> on the left. The <strong id="css_01_0093__en-us_topic_0000001268154473_b072011974018">Index Management</strong> page is displayed.</li><li id="css_01_0093__en-us_topic_0000001268154473_li6804104711597">Click <strong id="css_01_0093__en-us_topic_0000001268154473_b1972915323208">Create policy</strong> to create an index policy.</li><li id="css_01_0093__en-us_topic_0000001268154473_li66234455115">Enter a policy ID in the <strong id="css_01_0093__en-us_topic_0000001268154473_b1925817592111">Policy ID</strong> text box and enter your policy in the <strong id="css_01_0093__en-us_topic_0000001268154473_b572101772117">Define policy</strong> text box.<div class="fignone" id="css_01_0093__en-us_topic_0000001268154473_fig11427149204015"><span class="figcap"><b>Figure 1 </b>Configuring a policy</span><br><span><img id="css_01_0093__en-us_topic_0000001268154473_image318610322918" src="en-us_image_0000001666842890.png"></span></div>
|
|
</li><li id="css_01_0093__en-us_topic_0000001268154473_li652213431799">Click <strong id="css_01_0093__en-us_topic_0000001268154473_b996810391201">Create</strong>.</li></ol>
|
|
</div>
|
|
<div class="section" id="css_01_0093__en-us_topic_0000001268154473_section11451321182815"><h4 class="sectiontitle">Attaching a Policy to an Index</h4><p id="css_01_0093__en-us_topic_0000001268154473_p85771435104818">You can attach a policy to one or more indexes and add the policy ID to an index template. When you create indexes using that index template pattern, the policy will be attached to all created indexes.</p>
|
|
<ul id="css_01_0093__en-us_topic_0000001268154473_ul14378105912527"><li id="css_01_0093__en-us_topic_0000001268154473_li6378185910526"><strong id="css_01_0093__en-us_topic_0000001268154473_b1875164612020">Method 1: Kibana commands</strong><p id="css_01_0093__en-us_topic_0000001268154473_p193161652175311">On the <span class="uicontrol" id="css_01_0093__en-us_topic_0000001268154473_uicontrol127491655488"><b>Dev Tools</b></span> page of Kibana, run the following command to associate a policy ID with an index template:</p>
|
|
<pre class="screen" id="css_01_0093__en-us_topic_0000001268154473_screen25651257165413">PUT _template/<em id="css_01_0093__en-us_topic_0000001268154473_i2566165715544"><template_name></em><strong id="css_01_0093__en-us_topic_0000001268154473_b1756635712545"> </strong>
|
|
{
|
|
"index_patterns": ["index_name-*"],
|
|
"settings": {
|
|
"opendistro.index_state_management.policy_id": "<em id="css_01_0093__en-us_topic_0000001268154473_i13566185719549">policy_id</em>"
|
|
}
|
|
}</pre>
|
|
<ul id="css_01_0093__en-us_topic_0000001268154473_ul2017887556"><li id="css_01_0093__en-us_topic_0000001268154473_li5171383553"><em id="css_01_0093__en-us_topic_0000001268154473_i15841845106"><strong id="css_01_0093__en-us_topic_0000001268154473_b85016441206"><template_name></strong></em>: Replace it with the name of a created index template.</li><li id="css_01_0093__en-us_topic_0000001268154473_li161711813558"><em id="css_01_0093__en-us_topic_0000001268154473_i14362636001"><strong id="css_01_0093__en-us_topic_0000001268154473_b610611532015">policy_id</strong></em>: Replace it with a custom policy ID.</li></ul>
|
|
<p id="css_01_0093__en-us_topic_0000001268154473_p14340164895514">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 Template</a>.</p>
|
|
</li><li id="css_01_0093__en-us_topic_0000001268154473_li1055631185314"><strong id="css_01_0093__en-us_topic_0000001268154473_b10250910022">Method 2: Kibana console</strong><ol id="css_01_0093__en-us_topic_0000001268154473_ol1325191810517"><li id="css_01_0093__en-us_topic_0000001268154473_li625119181453">On the <strong id="css_01_0093__en-us_topic_0000001268154473_b11919255823">Index Management</strong> page of Kibana, choose <strong id="css_01_0093__en-us_topic_0000001268154473_b03796121939">Indices</strong>.<div class="fignone" id="css_01_0093__en-us_topic_0000001268154473_fig1125113181451"><span class="figcap"><b>Figure 2 </b>Choosing Indexes</span><br><span><img id="css_01_0093__en-us_topic_0000001268154473_image7252131816510" src="en-us_image_0000001667002610.png"></span></div>
|
|
</li><li id="css_01_0093__en-us_topic_0000001268154473_li1925216184512">In the <strong id="css_01_0093__en-us_topic_0000001268154473_b12310153193010">Indices</strong> list, select the target index to which you want to attach a policy.</li><li id="css_01_0093__en-us_topic_0000001268154473_li125212181054">Click <strong id="css_01_0093__en-us_topic_0000001268154473_b4659330664225">Apply policy</strong> in the upper right corner.<div class="fignone" id="css_01_0093__en-us_topic_0000001268154473_fig625215181650"><span class="figcap"><b>Figure 3 </b>Adding a policy</span><br><span><img id="css_01_0093__en-us_topic_0000001268154473_image625217181255" src="en-us_image_0000001666842894.png"></span></div>
|
|
</li><li id="css_01_0093__en-us_topic_0000001268154473_li122526185515">Select the policy you created from the <strong id="css_01_0093__en-us_topic_0000001268154473_b1616122633210">Policy ID</strong> drop-down list.<div class="fignone" id="css_01_0093__en-us_topic_0000001268154473_fig5252161812516"><span class="figcap"><b>Figure 4 </b>Selecting a policy</span><br><span><img id="css_01_0093__en-us_topic_0000001268154473_image725214188512" src="en-us_image_0000001714802389.png"></span></div>
|
|
</li><li id="css_01_0093__en-us_topic_0000001268154473_li11252151817519">Click <strong id="css_01_0093__en-us_topic_0000001268154473_b991611301244">Apply</strong>.<p id="css_01_0093__en-us_topic_0000001268154473_p122529181052">After you attach a policy to an index, ISM creates a job that runs every 5 minutes by default, to execute the policy, check conditions, and convert the index to different statuses.</p>
|
|
</li></ol>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="css_01_0093__en-us_topic_0000001268154473_section87941257192"><h4 class="sectiontitle">Managing Index Policies</h4><ol id="css_01_0093__en-us_topic_0000001268154473_ol15110119124"><li id="css_01_0093__en-us_topic_0000001268154473_li4512211151214">Click <strong id="css_01_0093__en-us_topic_0000001268154473_b867302793819">Managed Indices</strong>.</li><li id="css_01_0093__en-us_topic_0000001268154473_li1770054817133">If you want to change the policy, click <strong id="css_01_0093__en-us_topic_0000001268154473_b11334114593813">Change policy</strong>. For details, see <a href="css_01_0092.html">Changing Policies</a>.</li><li id="css_01_0093__en-us_topic_0000001268154473_li189823731912">To delete a policy, select your policy, and click <strong id="css_01_0093__en-us_topic_0000001268154473_b1323102854017">Remove policy</strong>.</li><li id="css_01_0093__en-us_topic_0000001268154473_li78981237171911">To retry a policy, select your policy, and click <strong id="css_01_0093__en-us_topic_0000001268154473_b350914715419">Retry policy</strong>.</li></ol>
|
|
<p id="css_01_0093__en-us_topic_0000001268154473_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 Indexes</a></div>
|
|
</div>
|
|
</div>
|
|
|