2018-10-26 15:19:52 -04:00
|
|
|
[role="xpack"]
|
|
|
|
[testenv="basic"]
|
2018-10-25 10:30:53 -04:00
|
|
|
[[start-stop-ilm]]
|
2018-12-20 13:23:28 -05:00
|
|
|
== Start and stop {ilm}
|
2018-10-25 10:30:53 -04:00
|
|
|
|
2018-11-16 13:49:55 -05:00
|
|
|
beta[]
|
|
|
|
|
2018-10-25 10:30:53 -04:00
|
|
|
All indices that are managed by ILM will continue to execute
|
|
|
|
their policies. There may be times when this is not desired on certain
|
|
|
|
indices, or maybe even all the indices in a cluster. For example,
|
|
|
|
maybe there are scheduled maintenance windows when cluster topology
|
|
|
|
changes are desired that may impact running ILM actions. For this reason,
|
|
|
|
ILM has two ways to disable operations.
|
|
|
|
|
|
|
|
Normally, ILM will be running by default.
|
|
|
|
To see the current operating status of ILM, use the <<ilm-get-status,Get Status API>>
|
|
|
|
to see the current state of ILM.
|
|
|
|
|
|
|
|
////
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2018-10-30 19:19:05 -04:00
|
|
|
PUT _ilm/policy/my_policy
|
2018-10-25 10:30:53 -04:00
|
|
|
{
|
|
|
|
"policy": {
|
|
|
|
"phases": {
|
|
|
|
"warm": {
|
2018-10-30 15:54:02 -04:00
|
|
|
"min_age": "10d",
|
2018-10-25 10:30:53 -04:00
|
|
|
"actions": {
|
|
|
|
"forcemerge": {
|
|
|
|
"max_num_segments": 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"delete": {
|
2018-10-30 15:54:02 -04:00
|
|
|
"min_age": "30d",
|
2018-10-25 10:30:53 -04:00
|
|
|
"actions": {
|
|
|
|
"delete": {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PUT my_index
|
|
|
|
{
|
|
|
|
"settings": {
|
|
|
|
"index.lifecycle.name": "my_policy"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
////
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
GET _ilm/status
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
|
|
|
|
If the request does not encounter errors, you receive the following result:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"operation_mode": "RUNNING"
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TESTRESPONSE
|
|
|
|
|
|
|
|
The operating modes of ILM:
|
|
|
|
|
|
|
|
|
|
|
|
.ILM Operating Modes
|
|
|
|
|===
|
|
|
|
|Name |Description
|
|
|
|
|RUNNING |Normal operation where all policies are executed as normal
|
|
|
|
|STOPPING|ILM has received a request to stop but is still processing some policies
|
|
|
|
|STOPPED |This represents a state where no policies are executed
|
|
|
|
|===
|
|
|
|
|
2018-11-16 13:49:55 -05:00
|
|
|
[float]
|
|
|
|
=== Stopping ILM=
|
2018-10-25 10:30:53 -04:00
|
|
|
|
|
|
|
The ILM service can be paused such that no further steps will be executed
|
|
|
|
using the <<ilm-stop,Stop API>>.
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
POST _ilm/stop
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[continued]
|
|
|
|
|
|
|
|
When stopped, all further policy actions will be halted. This will
|
|
|
|
be reflected in the Status API
|
|
|
|
|
|
|
|
////
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
GET _ilm/status
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[continued]
|
|
|
|
////
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"operation_mode": "STOPPING"
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TESTRESPONSE
|
|
|
|
|
|
|
|
The ILM service will then, asynchronously, run all policies to a point
|
|
|
|
where it is safe to stop. After ILM verifies that it is safe, it will
|
|
|
|
move to the `STOPPED` mode.
|
|
|
|
|
|
|
|
////
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
PUT trigger_ilm_cs_action
|
|
|
|
|
|
|
|
GET _ilm/status
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[continued]
|
|
|
|
////
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"operation_mode": "STOPPED"
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TESTRESPONSE
|
|
|
|
|
2018-11-16 13:49:55 -05:00
|
|
|
[float]
|
2018-10-25 10:30:53 -04:00
|
|
|
=== Starting ILM
|
|
|
|
|
|
|
|
To start ILM and continue executing policies, use the <<ilm-start, Start API>>.
|
|
|
|
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
POST _ilm/start
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[continued]
|
|
|
|
|
|
|
|
////
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
GET _ilm/status
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[continued]
|
|
|
|
////
|
|
|
|
|
|
|
|
The Start API will send a request to the ILM service to immediately begin
|
|
|
|
normal operations.
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"operation_mode": "RUNNING"
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TESTRESPONSE
|