I am totally lost on how Rollover works. I keep ending up with an error. I deleted my indexes and started fresh but still the same error everytime.
I am having following error and could not figure why this is happening. Any help is much appreciated!
"index.lifecycle.rollover_alias [ecom-alias] does not point to index [ecom-app-logs-2020.10.15-ecom-0000001]",
Below are step I followed:
- created an index template with pattern
ecom*
using this_index_template/ecom_app_logs
. Below are initial few lines.
{ "index_patterns": ["ecom-*"], "template": { "settings": { "number_of_shards": 1, "index.lifecycle.name": "ecom_ilm_policy", "index.lifecycle.rollover_alias":"ecom-alias" }, "mappings": { "properties": { "timestamp": {
- Created an index aliases
{ "aliases": { "ecom-alias": { "is_write_index": true } } }
-
Started logstash and below is the index name used in logstash output
output {if "ecom_app" in [tags]{ elasticsearch { hosts => ["eslocalhost:9200"] index => "ecom-app-logs-%{+YYYY.MM.dd}-ecom-0000001" #index => "ecom-0000001" # manage_template => true # template_name => "ecom_template" ilm_enabled => true }
Below is the complete error.
Also dont understand why ecom-log-rollover
is getting created.
{
"indices": {
"ecom-app-logs-2020.10.15-ecom-0000001": {
"index": "ecom-app-logs-2020.10.15-ecom-0000001",
"managed": true,
"policy": "ecom_ilm_policy",
"lifecycle_date_millis": 1602797100281,
"age": "15.61m",
"phase": "hot",
"phase_time_millis": 1602797100368,
"action": "rollover",
"action_time_millis": 1602797359629,
"step": "ERROR",
"step_time_millis": 1602797959362,
"failed_step": "check-rollover-ready",
"is_auto_retryable_error": true,
"step_info": {
"type": "illegal_argument_exception",
"reason": "index.lifecycle.rollover_alias [ecom-alias] does not point to index [ecom-app-logs-2020.10.15-ecom-0000001]",
"stack_trace": "java.lang.IllegalArgumentException: index.lifecycle.rollover_alias [ecom-alias] does not point to index [ecom-app-logs-2020.10.15-ecom-0000001]\n\tat org.elasticsearch.xpack.core.ilm.WaitForRolloverReadyStep.evaluateCondition(WaitForRolloverReadyStep.java:104)\n\tat org.elasticsearch.xpack.ilm.IndexLifecycleRunner.runPeriodicStep(IndexLifecycleRunner.java:173)\n\tat org.elasticsearch.xpack.ilm.IndexLifecycleService.triggerPolicies(IndexLifecycleService.java:329)\n\tat org.elasticsearch.xpack.ilm.IndexLifecycleService.triggered(IndexLifecycleService.java:267)\n\tat org.elasticsearch.xpack.core.scheduler.SchedulerEngine.notifyListeners(SchedulerEngine.java:183)\n\tat org.elasticsearch.xpack.core.scheduler.SchedulerEngine$ActiveSchedule.run(SchedulerEngine.java:211)\n\tat java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)\n\tat java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)\n\tat java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)\n\tat java.base/java.lang.Thread.run(Thread.java:832)\n"
},
"phase_execution": {
"policy": "ecom_ilm_policy",
"phase_definition": {
"min_age": "0ms",
"actions": {
"rollover": {
"max_size": "5mb",
"max_age": "1d"
},
"set_priority": {
"priority": null
}
}
},
"version": 3,
"modified_date_in_millis": 1602710733239
}
},
"ecom-0000001": {
"index": "ecom-0000001",
"managed": true,
"policy": "ecom_ilm_policy",
"lifecycle_date_millis": 1602797039893,
"age": "16.61m",
"phase": "hot",
"phase_time_millis": 1602797039975,
"action": "rollover",
"action_time_millis": 1602797359661,
"step": "check-rollover-ready",
"step_time_millis": 1602797359661,
"phase_execution": {
"policy": "ecom_ilm_policy",
"phase_definition": {
"min_age": "0ms",
"actions": {
"rollover": {
"max_size": "5mb",
"max_age": "1d"
},
"set_priority": {
"priority": null
}
}
},
"version": 3,
"modified_date_in_millis": 1602710733239
}
},
"ecom-log-rollover": {
"index": "ecom-log-rollover",
"managed": true,
"policy": "ecom_ilm_policy",
"lifecycle_date_millis": 1602797744342,
"age": "4.87m",
"phase": "hot",
"phase_time_millis": 1602797744443,
"action": "rollover",
"action_time_millis": 1602797959580,
"step": "check-rollover-ready",
"step_time_millis": 1602797959580,
"phase_execution": {
"policy": "ecom_ilm_policy",
"phase_definition": {
"min_age": "0ms",
"actions": {
"rollover": {
"max_size": "5mb",
"max_age": "1d"
},
"set_priority": {
"priority": null
}
}
},
"version": 3,
"modified_date_in_millis": 1602710733239
}
}
}
}