OpenSearch/docs/reference/ilm/start-stop-ilm.asciidoc

171 lines
3.8 KiB
Plaintext
Raw Normal View History

[role="xpack"]
[testenv="basic"]
[[start-stop-ilm]]
2018-12-20 13:23:28 -05:00
== Start and stop {ilm}
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]
--------------------------------------------------
PUT _ilm/policy/my_policy
{
"policy": {
"phases": {
"warm": {
"min_age": "10d",
"actions": {
"forcemerge": {
"max_num_segments": 1
}
}
},
"delete": {
"min_age": "30d",
"actions": {
"delete": {}
}
}
}
}
}
Update the default for include_type_name to false. (#37285) * Default include_type_name to false for get and put mappings. * Default include_type_name to false for get field mappings. * Add a constant for the default include_type_name value. * Default include_type_name to false for get and put index templates. * Default include_type_name to false for create index. * Update create index calls in REST documentation to use include_type_name=true. * Some minor clean-ups around the get index API. * In REST tests, use include_type_name=true by default for index creation. * Make sure to use 'expression == false'. * Clarify the different IndexTemplateMetaData toXContent methods. * Fix FullClusterRestartIT#testSnapshotRestore. * Fix the ml_anomalies_default_mappings test. * Fix GetFieldMappingsResponseTests and GetIndexTemplateResponseTests. We make sure to specify include_type_name=true during xContent parsing, so we continue to test the legacy typed responses. XContent generation for the typeless responses is currently only covered by REST tests, but we will be adding unit test coverage for these as we implement each typeless API in the Java HLRC. This commit also refactors GetMappingsResponse to follow the same appraoch as the other mappings-related responses, where we read include_type_name out of the xContent params, instead of creating a second toXContent method. This gives better consistency in the response parsing code. * Fix more REST tests. * Improve some wording in the create index documentation. * Add a note about types removal in the create index docs. * Fix SmokeTestMonitoringWithSecurityIT#testHTTPExporterWithSSL. * Make sure to mention include_type_name in the REST docs for affected APIs. * Make sure to use 'expression == false' in FullClusterRestartIT. * Mention include_type_name in the REST templates docs.
2019-01-14 16:08:01 -05:00
PUT my_index?include_type_name=true
{
"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
|===
[float]
=== Stopping ILM=
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
[float]
=== 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