Hi there!
I'm trying to set up the lifecycle of my indexes and I'm getting the following error:
"Index lifecycle error
illegal_argument_exception: index.lifecycle.rollover_alias [test-alias] does not point to index [test-2022.09.06]"
Here is my settings of logstash:
input {
beats {
port => 5044
}
}
output {
elasticsearch {
user => "my_username"
password => "my_password"
ssl => true
cacert => '/my_path_to_crt/my_crt.crt'
hosts => [ "https://localhost:9200" ]
index => "test-%{+YYYY.MM.dd}"
}
}
Here is my policy:
PUT _ilm/policy/my_policy
{
"policy": {
"phases": {
"hot": {
"min_age": "0ms",
"actions": {
"set_priority": {
"priority": 100
},
"rollover": {
"max_primary_shard_size": "50gb",
"max_age": "1m"
}
}
},
"delete": {
"min_age": "2m",
"actions": {
"delete": {
"delete_searchable_snapshot": true
}
}
}
}
}
}
Here is my template:
{
"template": {
"settings": {
"index": {
"lifecycle": {
"name": "my_policy",
"rollover_alias": "test-alias"
},
"routing": {
"allocation": {
"include": {
"_tier_preference": "data_content"
}
}
},
"number_of_shards": "1",
"number_of_replicas": "1"
}
},
"aliases": {},
"mappings": {}
}
}
All settings from the example which is here: elastic_docs
I tried to configure through the Kibana interface and through Dev Tools, the result is the same. I get the same error (given above).
Also create an initial managed index:
PUT test-000001
{
"aliases": {
"test-alias":{
"is_write_index": true
}
}
}
And this index works, it is rotated and deleted as described in the policy (hot phase 1 minute and older than 2 minutes are deleted). But its not green (health) it
s yellow and empty (Docs count 0).
At the same time, my index, which comes from the logstash, is not rotated, the template "test-000001" is not applied to it, but it is not empty, it is also yellow, not green, and when it comes time to rotate it, it gives the error that is indicated at the beginning of the post.
Read tons of docs but can't understand why it's not working correctly.
Could someone tell me what I'm doing wrong?