I have an index which uses ILM. The index rolls over every week. We use Spring-data to read and write for Elasticsearch. My index just rolled over today and we are having trouble with writing to it. It fails with the following error. We write to the es alias and not to the index name since ILM takes care of index management
Processor.process:61 - error occurred while saving DTOs:
org.springframework.data.elasticsearch.RestStatusException: Elasticsearch exception [type=illegal_argument_exception, reason=alias [analytics_alias] has more than one index associated with it [analytics_index-000001, analytics_index-000002], can't execute a single index op]; nested exception is ElasticsearchStatusException[Elasticsearch exception [type=illegal_argument_exception, reason=alias [analytics_alias] has more than one index associated with it [analytics_index-000001, analytics_index-000002], can't execute a single index op]]
However if you look at the alias only 1 alias is write
enabled
{
"analytics_index-000001" : {
"aliases" : {
"analytics_alias" : {
"is_write_index" : false
}
}
},
"analytics_index-000002" : {
"aliases" : {
"analytics_alias" : {
"is_write_index" : true
}
}
}
}