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>
133 lines
9.7 KiB
HTML
133 lines
9.7 KiB
HTML
<a name="css_01_0503"></a><a name="css_01_0503"></a>
|
|
|
|
<h1 class="topictitle1">Decoupling Index Storage and Compute in an OpenSearch Cluster Through Index Lifecycle Management</h1>
|
|
<div id="body0000001992205869"><div class="section" id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_section766512014019"><h4 class="sectiontitle">Overview</h4><p id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_p547911812417">CSS supports decoupled storage and compute. That is, indexes can be frozen in OBS to reduce the storage cost of cold data. This document describes how to use index lifecycle management to automatically freeze indexes at a specific time to decouple storage and compute.</p>
|
|
<p id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_p383294312412">In this section, a lifecycle policy is configured to automatically freeze an index three days after it is created and dump data to OBS. The index will be deleted seven days after it is created.</p>
|
|
<div class="fignone" id="css_01_0503__fig53155365182"><span class="figcap"><b>Figure 1 </b>Storage-compute decoupling</span><br><span><img id="css_01_0503__image7316936171810" src="en-us_image_0000002061403354.png"></span></div>
|
|
</div>
|
|
<div class="section" id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_section1453615515018"><h4 class="sectiontitle">Prerequisites</h4><ul id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_en-us_topic_0000001536523745_ul5400173012717"><li id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_en-us_topic_0000001536523745_li13400123014718">There are available CSS clusters.</li><li id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_en-us_topic_0000001536523745_li440012302071">OpenSearch 1.3.6 is used.</li></ul>
|
|
</div>
|
|
<div class="section" id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_section1068981011015"><h4 class="sectiontitle">Decoupling Index Storage and Compute Through Index Lifecycle Management</h4><ol id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_ol579517241688"><li id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_li395312182718">Log in to the <span id="css_01_0503__text6278642155419">CSS</span> management console.</li><li id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_li139539111279">In the navigation tree on the left, choose <strong id="css_01_0503__b37662440344710">Clusters</strong> > <strong id="css_01_0503__b207771301744710">OpenSearch</strong>. The cluster list is displayed.</li><li id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_li129531717274">Click <strong id="css_01_0503__b173411974344710">Access Kibana</strong> in the <strong id="css_01_0503__b163938523944710">Operation</strong> column of a cluster, and log in to OpenSearch Dashboards.</li><li id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_li59536117279">In the navigation tree on the left of OpenSearch Dashboards, choose <strong id="css_01_0503__b43926222244710">Dev Tools</strong>. The command execution page is displayed.</li><li id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_li10320113081711">Create a lifecycle policy named <strong id="css_01_0503__b158000585044710">hot_warm_policy</strong>.<p id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_p192937719172">Policy description: Three days after an index is created, the API for freezing indexes is automatically called to dump data to OBS. Seven days after index creation, the index is deleted.</p>
|
|
<pre class="screen" id="css_01_0503__screen1965991463314">PUT _plugins/_ism/policies/hot_warm_policy
|
|
{
|
|
"policy": {
|
|
"description": "hot warm delete workflow",
|
|
"error_notification": null,
|
|
"default_state": "hot",
|
|
"states": [
|
|
{
|
|
"name": "hot",
|
|
"actions": [],
|
|
"transitions": [
|
|
{
|
|
"state_name": "warm",
|
|
"conditions": {
|
|
"min_index_age": "3d"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "warm",
|
|
"actions": [
|
|
{
|
|
"freeze_low_cost": {}
|
|
}
|
|
],
|
|
"transitions": [
|
|
{
|
|
"state_name": "delete",
|
|
"conditions": {
|
|
"min_index_age": "7d"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "delete",
|
|
"actions": [
|
|
{
|
|
"delete": {}
|
|
}
|
|
],
|
|
"transitions": []
|
|
}
|
|
],
|
|
"ism_template": {
|
|
"index_patterns": [
|
|
"data*"
|
|
],
|
|
"priority": 100
|
|
}
|
|
}
|
|
}</pre>
|
|
</li><li id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_li115385520168">Create the index template <strong id="css_01_0503__b204831330344710">template_hot_warm</strong>.<p id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_p432502415202">Template description: All the new indexes starting with <strong id="css_01_0503__b210447626344710">data</strong> are automatically associated with the lifecycle policy <strong id="css_01_0503__b88553970044710">hot_warm_policy</strong>.</p>
|
|
<pre class="screen" id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_screen1532014017297">PUT _template/template_hot_warm
|
|
{
|
|
"index_patterns": "data*",
|
|
"settings": {
|
|
"number_of_replicas": 5,
|
|
"number_of_shards": 1,
|
|
"index.plugins.index_state_management.policy_id": "hot_warm_policy"
|
|
},
|
|
"mappings": {
|
|
"properties": {
|
|
"name": {
|
|
"type": "text"
|
|
}
|
|
}
|
|
}
|
|
}</pre>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_table1969461617545" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_row369411165549"><th align="left" class="cellrowborder" valign="top" width="60%" id="mcps1.3.3.2.6.4.2.3.1.1"><p id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_p069431635417">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="40%" id="mcps1.3.3.2.6.4.2.3.1.2"><p id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_p5694816135416">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_row1169441645413"><td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.3.2.6.4.2.3.1.1 "><p id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_p12694151605412">number_of_shards</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.6.4.2.3.1.2 "><p id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_p769411169541">Number of index shards</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_row1769481685420"><td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.3.2.6.4.2.3.1.1 "><p id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_p66941716135418">number_of_replicas</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.6.4.2.3.1.2 "><p id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_p126949169540">Number of index shard replicas</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_row1694161611544"><td class="cellrowborder" valign="top" width="60%" headers="mcps1.3.3.2.6.4.2.3.1.1 "><p id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_p1369411620549">index.plugins.index_state_management.policy_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="40%" headers="mcps1.3.3.2.6.4.2.3.1.2 "><p id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_p4694141616548">Lifecycle policy name</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li><li id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_li1812715651911">Create the <strong id="css_01_0503__b184439018344710">data-2022-06-06</strong> index. The index automatically uses the <strong id="css_01_0503__b87809563744710">template_hot_warm</strong> template and associates the index template with the lifecycle policy <strong id="css_01_0503__b97135085544710">hot_warm_policy</strong>. As such, the index is frozen three days after creation and is deleted seven days after creation.<pre class="screen" id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_screen0172542193514">POST data-2022-06-06/_bulk
|
|
{"index":{}}
|
|
{"name":"name1"}
|
|
{"index":{}}
|
|
{"name":"name2"}
|
|
{"index":{}}
|
|
{"name":"name3"}
|
|
{"index":{}}
|
|
{"name":"name4"}
|
|
{"index":{}}
|
|
{"name":"name5"}
|
|
{"index":{}}
|
|
{"name":"name6"}</pre>
|
|
</li><li id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_li1097520318466">Query data and check whether storage and compute is automatically decoupled.<ul id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_ul8362175954713"><li id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_li1036255920479">Three days after the index is created, check the frozen index.<pre class="screen" id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_screen19429203814233">GET _cat/freeze_indices?s=i&v</pre>
|
|
<p id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_p19852165814220">The index generated three days ago is expected to be frozen.</p>
|
|
<pre class="screen" id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_screen114951851172411">health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
|
|
green open <strong id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_b19520181484710">data-2022-06-06</strong> x8ab5NX6T3Ox_xoGUanogQ 1 1 6 0 7.6kb 3.8kb</pre>
|
|
</li><li id="css_01_0503__css_01_0421_en-us_topic_0000001934020326_li1436295964717">Seven days after the index is created, check the frozen index. The index is expected to be deleted.</li></ul>
|
|
</li></ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="css_01_0501.html">Managing Index Policies for OpenSearch Clusters</a></div>
|
|
</div>
|
|
</div>
|
|
|