ILM not applying to metricbeats index

Hello,
I'm almost running out of space due to metricbeats index becoming very big, ILM is already applied but doesn't take my settings in account but index never decreases, thanks for your help.

ILM

PUT _ilm/policy/metricbeat

{
"policy": {
"phases": {
"hot": {
"min_age": "0ms",
"actions": {
"rollover": {
"max_size": "500mb",
"max_age": "7d"
},
"set_priority": {
"priority": 100
}
}
},
"delete": {
"min_age": "14d",
"actions": {
"delete": {
"delete_searchable_snapshot": true
}
}
}
}
}
}

metricbeat-7.11.2-2021.04.30-000001 stats:

{

"_shards": {
"total": 2,
"successful": 2,
"failed": 0
},
"stats": {
"uuid": "MFaP3G_DRDyFgWDXGCkjAg",
"primaries": {
"docs": {
"count": 7402606,
"deleted": 0
},
"store": {
"size_in_bytes": 2450217442,
"reserved_in_bytes": 0
},
"indexing": {
"index_total": 0,
"index_time_in_millis": 0,
"index_current": 0,
"index_failed": 0,
"delete_total": 0,
"delete_time_in_millis": 0,
"delete_current": 0,
"noop_update_total": 0,
"is_throttled": false,
"throttle_time_in_millis": 0
},
"get": {
"total": 0,
"time_in_millis": 0,
"exists_total": 0,
"exists_time_in_millis": 0,
"missing_total": 0,
"missing_time_in_millis": 0,
"current": 0
},
"search": {
"open_contexts": 0,
"query_total": 256,
"query_time_in_millis": 114,
"query_current": 0,
"fetch_total": 0,
"fetch_time_in_millis": 0,
"fetch_current": 0,
"scroll_total": 0,
"scroll_time_in_millis": 0,
"scroll_current": 0,
"suggest_total": 0,
"suggest_time_in_millis": 0,
"suggest_current": 0
},
"merges": {
"current": 0,
"current_docs": 0,
"current_size_in_bytes": 0,
"total": 0,
"total_time_in_millis": 0,
"total_docs": 0,
"total_size_in_bytes": 0,
"total_stopped_time_in_millis": 0,
"total_throttled_time_in_millis": 0,
"total_auto_throttle_in_bytes": 20971520
},
"refresh": {
"total": 10,
"total_time_in_millis": 0,
"external_total": 2,
"external_total_time_in_millis": 1,
"listeners": 0
},
"flush": {
"total": 1,
"periodic": 0,
"total_time_in_millis": 0
},
"warmer": {
"current": 0,
"total": 1,
"total_time_in_millis": 1
},
"query_cache": {
"memory_size_in_bytes": 0,
"total_count": 337,
"hit_count": 0,
"miss_count": 337,
"cache_size": 0,
"cache_count": 0,
"evictions": 0
},
"fielddata": {
"memory_size_in_bytes": 0,
"evictions": 0
},
"completion": {
"size_in_bytes": 0
},
"segments": {
"count": 28,
"memory_in_bytes": 799448,
"terms_memory_in_bytes": 305088,
"stored_fields_memory_in_bytes": 15744,
"term_vectors_memory_in_bytes": 0,
"norms_memory_in_bytes": 0,
"points_memory_in_bytes": 0,
"doc_values_memory_in_bytes": 478616,
"index_writer_memory_in_bytes": 0,
"version_map_memory_in_bytes": 0,
"fixed_bit_set_memory_in_bytes": 926560,
"max_unsafe_auto_id_timestamp": 1622236394778,
"file_sizes": {}
},
"translog": {
"operations": 0,
"size_in_bytes": 55,
"uncommitted_operations": 0,
"uncommitted_size_in_bytes": 55,
"earliest_last_modified_age": 152701240
},
"request_cache": {
"memory_size_in_bytes": 55126,
"evictions": 0,
"hit_count": 202,
"miss_count": 41
},
"recovery": {
"current_as_source": 0,
"current_as_target": 0,
"throttle_time_in_millis": 0
}
},
"total": {
"docs": {
"count": 14805212,
"deleted": 0
},
"store": {
"size_in_bytes": 4904368707,
"reserved_in_bytes": 0
},
"indexing": {
"index_total": 0,
"index_time_in_millis": 0,
"index_current": 0,
"index_failed": 0,
"delete_total": 0,
"delete_time_in_millis": 0,
"delete_current": 0,
"noop_update_total": 0,
"is_throttled": false,
"throttle_time_in_millis": 0
},
"get": {
"total": 0,
"time_in_millis": 0,
"exists_total": 0,
"exists_time_in_millis": 0,
"missing_total": 0,
"missing_time_in_millis": 0,
"current": 0
},
"search": {
"open_contexts": 0,
"query_total": 256,
"query_time_in_millis": 114,
"query_current": 0,
"fetch_total": 0,
"fetch_time_in_millis": 0,
"fetch_current": 0,
"scroll_total": 0,
"scroll_time_in_millis": 0,
"scroll_current": 0,
"suggest_total": 0,
"suggest_time_in_millis": 0,
"suggest_current": 0
},
"merges": {
"current": 0,
"current_docs": 0,
"current_size_in_bytes": 0,
"total": 0,
"total_time_in_millis": 0,
"total_docs": 0,
"total_size_in_bytes": 0,
"total_stopped_time_in_millis": 0,
"total_throttled_time_in_millis": 0,
"total_auto_throttle_in_bytes": 41943040
},
"refresh": {
"total": 13,
"total_time_in_millis": 0,
"external_total": 4,
"external_total_time_in_millis": 2,
"listeners": 0
},
"flush": {
"total": 2,
"periodic": 0,
"total_time_in_millis": 0
},
"warmer": {
"current": 0,
"total": 2,
"total_time_in_millis": 2
},
"query_cache": {
"memory_size_in_bytes": 0,
"total_count": 337,
"hit_count": 0,
"miss_count": 337,
"cache_size": 0,
"cache_count": 0,
"evictions": 0
},
"fielddata": {
"memory_size_in_bytes": 0,
"evictions": 0
},
"completion": {
"size_in_bytes": 0
},
"segments": {
"count": 59,
"memory_in_bytes": 1662716,
"terms_memory_in_bytes": 645984,
"stored_fields_memory_in_bytes": 33064,
"term_vectors_memory_in_bytes": 0,
"norms_memory_in_bytes": 0,
"points_memory_in_bytes": 0,
"doc_values_memory_in_bytes": 983668,
"index_writer_memory_in_bytes": 0,
"version_map_memory_in_bytes": 0,
"fixed_bit_set_memory_in_bytes": 926560,
"max_unsafe_auto_id_timestamp": 1622236394778,
"file_sizes": {}
},
"translog": {
"operations": 0,
"size_in_bytes": 110,
"uncommitted_operations": 0,
"uncommitted_size_in_bytes": 110,
"earliest_last_modified_age": 26248925
},
"request_cache": {
"memory_size_in_bytes": 55126,
"evictions": 0,
"hit_count": 202,
"miss_count": 41
},
"recovery": {
"current_as_source": 0,
"current_as_target": 0,
"throttle_time_in_millis": 0
}
}
}
}

settings:
{
"index.blocks.read_only_allow_delete": "false",
"index.write.wait_for_active_shards": "1",
"index.mapping.total_fields.limit": "10000",
"index.refresh_interval": "5s",
"index.query.default_field": [
...
],
"index.priority": "100",
"index.number_of_replicas": "1",
"index.lifecycle.name": "metricbeat",
"index.lifecycle.rollover_alias": "metricbeat-7.11.2",
"index.lifecycle.indexing_complete": "true",
"index.routing.allocation.include._tier_preference": "data_content",
"index.max_docvalue_fields_search": "200"
}

metricbeat-7.11.2-2021.05.30-000002 exists and not so big.

Thanks.

Hi,
looks like rollover settings didn't apply for some reason on 1st rolled index but from 2nd so I finally used this query to purge:

DELETE metricbeat-7.11.2-2021.04.30-000001

Hi, take another look at the documentation of the Rollover action: Rollover | Elasticsearch Guide [7.13] | Elastic

Under max_size is the info: "Replicas are not counted toward the maximum index size."

Your index has 1 primary and 1 replica shard. The size of the the primary shards is 278.1mb, which is the size that is counted by the ILM policy. Your policy acts for a max size of 500mb.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.