kibana/x-pack/plugins/index_lifecycle_management
Jean-Louis Leysens 61a51b5684
[ILM] New copy for rollover and small refactor for timeline (#89422)
* refactor timeline and relative ms calculation logic for easier use outside of edit_policy section

* further refactor, move child component to own file in timeline, and clean up public API for relative timing calculation

* added copy to call out variation in timing (slop) introduced by rollover

* use separate copy for timeline

* remove unused import

* fix unresolved merge

* implement copy feedback

* added component integration for showing/hiding hot phase icon on timeline

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2021-02-01 11:14:46 +01:00
..
__jest__ [ILM] New copy for rollover and small refactor for timeline (#89422) 2021-02-01 11:14:46 +01:00
common [ILM] Timeline component (#88024) 2021-01-26 22:34:43 +01:00
public [ILM] New copy for rollover and small refactor for timeline (#89422) 2021-02-01 11:14:46 +01:00
server [ILM] Surface linked hidden indices for policies (#87960) 2021-01-13 14:50:01 -05:00
jest.config.js Jest multi-project configuration (#77894) 2020-12-02 11:42:23 -08:00
kibana.json Add ILM url generator and use it in Index Management (#82165) 2020-11-06 15:42:51 +01:00
README.md [ILM] Data tier notices should reflect tier preferences (#78398) 2020-09-30 12:42:05 +02:00

Index Lifecycle Management

Testing

Quick steps for testing ILM in Index Management

You can test that the Frozen badge, phase filtering, and lifecycle information is surfaced in Index Management by running this series of requests in Console:

PUT /_ilm/policy/full
{
  "policy": {
    "phases" : {
      "hot" : {
        "min_age" : "0ms",
        "actions" : {
          "rollover" : {
            "max_docs" : 1
          }
        }
      },
      "warm" : {
        "min_age" : "15s",
        "actions" : {
          "forcemerge" : {
            "max_num_segments" : 1
          },
          "shrink" : {
            "number_of_shards" : 1
          }
        }
      },
      "cold" : {
        "min_age" : "30s",
        "actions" : {
          "freeze": {}
        }
      },
      "delete" : {
        "min_age" : "1d",
        "actions" : {
          "delete" : { }
        }
      }
    }
  }
}

PUT _template/test
{
  "index_patterns": ["test-*"],
  "settings": {
    "number_of_shards": 3,
    "number_of_replicas": 0,
    "index.lifecycle.name": "full",
    "index.lifecycle.rollover_alias": "test-alias"
  }
}

PUT /test-000001
{
  "aliases": {
    "test-alias": {
      "is_write_index": true
    }
  }
}

PUT test-alias/_doc/1
{
  "a": "a"
}

PUT /_cluster/settings
{
  "transient": {
    "logger.org.elasticsearch.xpack.core.indexlifecycle": "TRACE",
    "logger.org.elasticsearch.xpack.indexlifecycle": "TRACE",
    "logger.org.elasticsearch.xpack.core.ilm": "TRACE",
    "logger.org.elasticsearch.xpack.ilm": "TRACE",
    "indices.lifecycle.poll_interval": "10s"
  }
}

Then go into Index Management and, after about 1 minute, you'll see a frozen index and you'll be able to filter by the various lifecycle phases and statuses.

image

Next, add the Kibana sample data and attach the full policy to the index that gets created. After about a minute, there should be an error on this index. When you click the index you'll see ILM information in the detail panel as well as an error. You can dismiss the error by clicking Manage > Retry lifecycle step.

image

Data tier notifications

When creating or editing an ILM policy the UI should notify users that under certain conditions their data will not be moved to a tier corresponding to a phase. For instance, when a cluster only has hot-tier nodes. We test the UI with this cluster state by starting an ES node with the data_hot role. Using this command:

yarn es snapshot --license=trial -E node.roles=data_hot,master,data_content

This will create a cluster where we have a single node that belongs to the hot-tier. In the data allocation section of both the warm and cold phase you should see notice like the following:

image

Default configuration for a node is that it belongs to all tiers, in which case you should not see this notice. Test this by running:

yarn es snapshot --license=trial