Creating and Managing Index Policies for an Elasticsearch Cluster

This topic describes how to create and manage index lifecycle policies for Elasticsearch clusters.

Context

Index State Management (ISM) of Elasticsearch 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:

  1. Creating an Index Lifecycle Policy: Create an index lifecycle policy on OpenSearch Dashboards.
  2. Associating Indexes with a Lifecycle Policy: Associate indexes with a lifecycle policy.
  3. Managing Index Policies: Modify, retry, and change index lifecycle policies.

For more information about ISM, see Index State Management.

Constraints

Creating an Index Lifecycle Policy

  1. Log in to the CSS management console.
  2. In the navigation pane on the left, choose Clusters > Elasticsearch.
  3. In the cluster list, find the target cluster, and click Kibana in the Operation column to log in to the Kibana console.
  4. On the Kibana console, expand the menu in the upper-left corner, and choose IM or Index Management to go to the index management page.
  5. Click Create policy to configure an index lifecycle policy.
    • Policy ID: use a custom policy name.
    • Define policy: define a custom policy based on the reference example provided.
    Figure 1 Configuring a policy
  6. Click Create.

Associating Indexes with a Lifecycle Policy

You can attach 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 either of the following methods to associate a lifecycle policy with an index.

Managing Index Policies

  1. On the Index Management page of the Kibana console, choose Managed Indices.

    The displayed page shows index policies configured for the current cluster.

  2. Manage policies in the index policy list.
    • For a policy whose status is abnormal, click Retry policy.
    • To update a policy for an index, select the associated index, and click Change policy. After the policy is updated, click Change to apply the new policy.
    • To remove a policy from an index, select the index, and click Remove policy. In the displayed dialog box, click Remove.

For details, see Index State Management.