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>
49 lines
11 KiB
HTML
49 lines
11 KiB
HTML
<a name="EN-US_TOPIC_0000001965496865"></a><a name="EN-US_TOPIC_0000001965496865"></a>
|
|
|
|
<h1 class="topictitle1">Creating and Managing OpenSearch Index Policies</h1>
|
|
<div id="body8662426"><p id="EN-US_TOPIC_0000001965496865__p17682103664518">This topic describes how to create and manage index lifecycle policies for OpenSearch clusters.</p>
|
|
<div class="section" id="EN-US_TOPIC_0000001965496865__section570781916170"><h4 class="sectiontitle">Context</h4><p id="EN-US_TOPIC_0000001965496865__p9627569502">Index State Management (ISM) of OpenSearch is a plugin that allows you to automate periodic, administrative operations on indexes by triggering them based on changes in the index age, index size, or number of documents. With ISM, you can define custom policies to automate index rollovers and deletion, thus optimizing cluster search performance or cutting storage costs. The procedure for using ISM is as follows:</p>
|
|
<ol id="EN-US_TOPIC_0000001965496865__ol182015215117"><li id="EN-US_TOPIC_0000001965496865__li202010218518"><a href="#EN-US_TOPIC_0000001965496865__en-us_topic_0000001477739392_en-us_topic_0000001268154473_section779154094817">Creating an Index Lifecycle Policy</a>: Create an index lifecycle policy on OpenSearch Dashboards.</li><li id="EN-US_TOPIC_0000001965496865__li695231615510"><a href="#EN-US_TOPIC_0000001965496865__en-us_topic_0000001477739392_en-us_topic_0000001268154473_section11451321182815">Associating Indexes with a Lifecycle Policy</a>: Associate indexes with a lifecycle policy.</li><li id="EN-US_TOPIC_0000001965496865__li148518914513"><a href="#EN-US_TOPIC_0000001965496865__en-us_topic_0000001477739392_en-us_topic_0000001268154473_section87941257192">Managing Index Policies</a>: Modify, retry, and change index lifecycle policies.</li></ol>
|
|
<p id="EN-US_TOPIC_0000001965496865__p18766571223">For more information about ISM, see <a href="https://opendistro.github.io/for-elasticsearch-docs/docs/im/ism/" target="_blank" rel="noopener noreferrer">Index State Management</a>.</p>
|
|
<p id="EN-US_TOPIC_0000001965496865__p13829172812415">The OpenSearch Dashboards GUI may vary depending on the software version. OpenSearch Dashboards 1.3.6 is used as an example here.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001965496865__en-us_topic_0000001477739392_en-us_topic_0000001268154473_section779154094817"><a name="EN-US_TOPIC_0000001965496865__en-us_topic_0000001477739392_en-us_topic_0000001268154473_section779154094817"></a><a name="en-us_topic_0000001477739392_en-us_topic_0000001268154473_section779154094817"></a><h4 class="sectiontitle">Creating an Index Lifecycle Policy</h4><ol id="EN-US_TOPIC_0000001965496865__ol109311171818"><li id="EN-US_TOPIC_0000001965496865__li63071618116"><span id="EN-US_TOPIC_0000001965496865__ph152259618315">Log in to the CSS management console.</span></li><li id="EN-US_TOPIC_0000001965496865__li75987122113">In the navigation pane on the left, choose <span class="uicontrol" id="EN-US_TOPIC_0000001965496865__uicontrol133111264111"><b>Clusters > OpenSearch</b></span>.</li><li id="EN-US_TOPIC_0000001965496865__li1840143761113">In the cluster list, find the target cluster, and click <strong id="EN-US_TOPIC_0000001965496865__b37746582142116">Dashboards</strong> in the <strong id="EN-US_TOPIC_0000001965496865__b37205717542116">Operation</strong> column to log in to OpenSearch Dashboards.</li><li id="EN-US_TOPIC_0000001965496865__li8978162804611">Expand the OpenSearch Dashboards menu in the upper-left corner, and choose <span class="wintitle" id="EN-US_TOPIC_0000001965496865__en-us_topic_0000001477739392_en-us_topic_0000001268154473_wintitle97769271640"><b>Index Management</b></span>.</li><li id="EN-US_TOPIC_0000001965496865__li11840140714">Click <span class="uicontrol" id="EN-US_TOPIC_0000001965496865__uicontrol837161155219"><b>Create policy</b></span> to create an index policy. In the <strong id="EN-US_TOPIC_0000001965496865__b53667313512">Configuration method</strong> dialog box, select <strong id="EN-US_TOPIC_0000001965496865__b93661738518">JSON editor</strong> and click <strong id="EN-US_TOPIC_0000001965496865__b1536673125119">Continue</strong>. The page for creating an index policy is displayed.<ul id="EN-US_TOPIC_0000001965496865__ul226466194715"><li id="EN-US_TOPIC_0000001965496865__li12459122884713"><span class="parmname" id="EN-US_TOPIC_0000001965496865__parmname1102005413"><b>Policy ID</b></span>: use a custom policy name. </li><li id="EN-US_TOPIC_0000001965496865__li426586144717"><span class="parmname" id="EN-US_TOPIC_0000001965496865__parmname108321546544"><b>Define policy</b></span>: define a custom policy based on the reference example provided.<div class="fignone" id="EN-US_TOPIC_0000001965496865__fig151344549115"><span class="figcap"><b>Figure 1 </b>Configuring a policy</span><br><span><img id="EN-US_TOPIC_0000001965496865__image1013414545115" src="figure/en-us_image_0000001999761193.png"></span><p id="EN-US_TOPIC_0000001965496865__p132095219499">In the following example, a policy named <span class="parmvalue" id="EN-US_TOPIC_0000001965496865__parmvalue12341122975118"><b>policy1</b></span> is created. The <span class="parmname" id="EN-US_TOPIC_0000001965496865__parmname119315328510"><b>ism_template</b></span> part specifies the indexes to apply the policy to. After the policy is created, indexes whose names start with <span class="parmvalue" id="EN-US_TOPIC_0000001965496865__parmvalue7324173717510"><b>test</b></span> are automatically associated with this policy.</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001965496865__screen5908174212488">PUT _plugins/_ism/policies/policy1
|
|
{
|
|
"policy": {
|
|
"description": "an example policy",
|
|
"default_state": "hot",
|
|
"states": [
|
|
// Ignore the states part.
|
|
],
|
|
"ism_template": {
|
|
"index_patterns": [
|
|
"test*"
|
|
],
|
|
"priority": 100
|
|
}
|
|
}
|
|
}</pre>
|
|
</div>
|
|
</li></ul>
|
|
</li><li id="EN-US_TOPIC_0000001965496865__li46811119210">Click <span class="uicontrol" id="EN-US_TOPIC_0000001965496865__uicontrol11130181325216"><b>Create</b></span>.</li></ol>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001965496865__en-us_topic_0000001477739392_en-us_topic_0000001268154473_section11451321182815"><a name="EN-US_TOPIC_0000001965496865__en-us_topic_0000001477739392_en-us_topic_0000001268154473_section11451321182815"></a><a name="en-us_topic_0000001477739392_en-us_topic_0000001268154473_section11451321182815"></a><h4 class="sectiontitle">Associating Indexes with a Lifecycle Policy</h4><div class="p" id="EN-US_TOPIC_0000001965496865__en-us_topic_0000001477739392_en-us_topic_0000001268154473_p85771435104818">You can bind a policy to one or more indexes, or associate a policy with an index template, so that the policy will be applied to all indexes created using this index template. Use this method when associating existing indexes with a lifecycle policy.<ol id="EN-US_TOPIC_0000001965496865__en-us_topic_0000001477739392_en-us_topic_0000001268154473_ol1325191810517"><li id="EN-US_TOPIC_0000001965496865__en-us_topic_0000001477739392_en-us_topic_0000001268154473_li625119181453">On the <span class="wintitle" id="EN-US_TOPIC_0000001965496865__en-us_topic_0000001477739392_en-us_topic_0000001268154473_wintitle23824172612"><b>Index Management</b></span> page of the OpenSearch Dashboards, choose <strong id="EN-US_TOPIC_0000001965496865__en-us_topic_0000001477739392_en-us_topic_0000001268154473_b12511018252">Indexes</strong>.</li><li id="EN-US_TOPIC_0000001965496865__en-us_topic_0000001477739392_en-us_topic_0000001268154473_li1925216184512">In the <strong id="EN-US_TOPIC_0000001965496865__b1484814218339">Indexes</strong> list, select one or more indexes that you want to bind with a policy.</li><li id="EN-US_TOPIC_0000001965496865__en-us_topic_0000001477739392_en-us_topic_0000001268154473_li125212181054">Click <strong id="EN-US_TOPIC_0000001965496865__b166851312175412">Apply policy</strong> in the upper-right corner. In the displayed dialog box, select <span class="uicontrol" id="EN-US_TOPIC_0000001965496865__uicontrol14294331195318"><b>Policy ID</b></span>.<div class="fignone" id="EN-US_TOPIC_0000001965496865__fig1493917576136"><span class="figcap"><b>Figure 2 </b>Apply policy</span><br><span><img id="EN-US_TOPIC_0000001965496865__image1398894241310" src="figure/en-us_image_0000001938218604.png"></span></div>
|
|
<div class="fignone" id="EN-US_TOPIC_0000001965496865__fig2986201519175"><span class="figcap"><b>Figure 3 </b>Selecting a policy</span><br><span><img id="EN-US_TOPIC_0000001965496865__image1298610152174" src="figure/en-us_image_0000001963261856.png"></span></div>
|
|
</li><li id="EN-US_TOPIC_0000001965496865__li669961645919">Click <strong id="EN-US_TOPIC_0000001965496865__b1645616913384">Apply</strong>.<p id="EN-US_TOPIC_0000001965496865__p15699151665919">After you bind a policy to an index, ISM creates a job that runs every 5 minutes by default to execute the policy, check criteria, and change index states.</p>
|
|
</li></ol>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001965496865__en-us_topic_0000001477739392_en-us_topic_0000001268154473_section87941257192"><a name="EN-US_TOPIC_0000001965496865__en-us_topic_0000001477739392_en-us_topic_0000001268154473_section87941257192"></a><a name="en-us_topic_0000001477739392_en-us_topic_0000001268154473_section87941257192"></a><h4 class="sectiontitle">Managing Index Policies</h4><ol id="EN-US_TOPIC_0000001965496865__en-us_topic_0000001477739392_en-us_topic_0000001268154473_ol15110119124"><li id="EN-US_TOPIC_0000001965496865__en-us_topic_0000001477739392_en-us_topic_0000001268154473_li4512211151214">On the <strong id="EN-US_TOPIC_0000001965496865__b38351615124220">Index Management</strong> page of the OpenSearch Dashboards, choose <strong id="EN-US_TOPIC_0000001965496865__b14685839174215">Managed Indices</strong>.<p id="EN-US_TOPIC_0000001965496865__p10946547193112">The displayed page shows index policies configured for the current cluster.</p>
|
|
</li><li id="EN-US_TOPIC_0000001965496865__li158123449312">Manage policies in the index policy list.<ul id="EN-US_TOPIC_0000001965496865__ul9908193411329"><li id="EN-US_TOPIC_0000001965496865__li590823415323">For a policy whose status is abnormal, click <strong id="EN-US_TOPIC_0000001965496865__b871416304516">Retry policy</strong>.</li><li id="EN-US_TOPIC_0000001965496865__li15527184110338">To update a policy for an index, select the associated index, and click <strong id="EN-US_TOPIC_0000001965496865__b1586415412304">Change policy</strong>. After the policy is updated, click <strong id="EN-US_TOPIC_0000001965496865__b28641354133019">Change</strong> to apply the new policy.</li><li id="EN-US_TOPIC_0000001965496865__li34482542391">To remove a policy from an index, select the index, and click <strong id="EN-US_TOPIC_0000001965496865__b25571550162915">Remove policy</strong>. In the displayed dialog box, click <strong id="EN-US_TOPIC_0000001965496865__b9558195012294">Remove</strong>.</li></ul>
|
|
</li></ol>
|
|
<p id="EN-US_TOPIC_0000001965496865__en-us_topic_0000001477739392_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_0320.html">Managing Index Policies for OpenSearch Clusters</a></div>
|
|
</div>
|
|
</div>
|
|
|