-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ILM: Change of setup.ilm.pattern
is not applied even with setup.ilm.overwrite
set.
#24111
Comments
In the code I can see that the The code that handles the alias creation ( I'm not sure it's easy to fix this, because the original pattern used to create an alias is lost, in my tests if the alias is replaced for a pattern, it will reset the counts, starting with |
Pinging @elastic/agent (Team:Agent) |
An alias can not be created independently. For ILM setup we first need to create the ILM policy, then upload the template, and finally create the first index with the associated alias. The indices are now under control of Elasticsearch ILM and should not be updated. The code only checks if the alias exist, not that the current associated index matches the given pattern (which is somewhat Elasticsearch specific).
Correct. One must create the first index manually. The setup code assumes that your "setup" is new. We do not read the old associated index name. There is also no logic to check if the current name matches the index naming pattern (which syntax is specific to ES). The setup command aims at providing an initial setup to have the stack prepared before publishing events. But there are limits to it. Something we might want to consider is to reduce the "burden" by allowing users to create datastreams instead of indices + aliases (which is somewhat fragile at times). Datastreams kinda unifies the experience by making sure that Elasticsearch handles associated resource internally. One can use ES API or Kibana to apply changes to a Datastream. For the Beats setup this means that we would not need to setup an alias at all. Instead we just add Note: The ILM pattern configures the index naming, not the alias. At worst changing the ILM pattern might interfere with ILM, such that old indices are not correctly handled anymore. Once the alias exists, ILM is in full control of the indices. |
Thanks for chiming in, @urso. Then I understand the best we can do at this time is to update the docs to make this more clear? Instead of
can we suggest to remove the existing aliases and remind the user that old indices under the previous pattern won't we subject to ILM anymore? |
Sure. s/won't/might/ |
For confirmed bugs, please report:
Contrary to our documentation, changes to
setup.ilm.pattern
doesn't apply if the alias already exists. It keeps using the previous pattern.Run a Beat with:
This works and the alias
myindex5
=>myindex5-000001
gets created.Now replace the pattern:
Run
beatname setup --index-management
and then ingest more documents.The Beat is still indexing using the previous pattern, and the write alias is still
myindex5
=>myindex5-000001
.If the alias is removed before running
setup
, then the correct alias is created,myindex5
=>myindex5-2021.02-000001
.Documentation states:
The text was updated successfully, but these errors were encountered: