-
Notifications
You must be signed in to change notification settings - Fork 25.3k
Remove file based default mappings #10870
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
Conversation
LGTM. Let's just add a note to the 2.0 migration guide? |
Also need to delete this page: http://www.elastic.co/guide/en/elasticsearch/reference/master/mapping-conf-mappings.html |
I appreciate the irony of having to use local files for scripting. |
<sigh> yes </sigh> |
LGTM |
Using files that must be specified on each node is an anti-pattern from the API based goal of ES. This change removes the ability to specify the default mapping with a file on each node. closes elastic#10620
As a follow up to elastic#10870, this removes support for index templates on disk. It also removes a missed place still allowing disk based mappings.
As a follow up to elastic#10870, this removes support for index templates on disk. It also removes a missed place still allowing disk based mappings.
As a follow up to elastic#10870, this removes support for index templates on disk. It also removes a missed place still allowing disk based mappings. closes elastic#11052
so for those of us who actually want changelog based operations - that is no longer an option? We must "trust" whomever gets access to the API - to remember to also write to a changelog - so we know the change has been made.. ? (or write "yet another script" myself) I - and many others - prefer to make centralized configuration changes, which we then commit and roll out into production.. using puppet f.ex. This change means its no longer possible to let puppet manage how ones indexes is setup.. a fairly major part of ES configuration :( I can hack around it.. write some script, which is executed on the change of a template - which then loads it into ES using http.. but I would call it an anti-pattern to make sure users can't use configuration management to manage their ES installations (without scripting it themselves). I do realize the current ES handling of templates is subpar.. it would be better to set it up to f.ex. use inotify - so it is informed by the kernel when an index template file is updated - and then simply try to verify and load it.. and if this fails it could log it - and even mail it if need be.. |
What exactly is the scope of this change? Is the ability to specify a default index template via files also removed? The docs are not clear:
I am assuming for now template files are also subject to this change, because mine are being ignored. From an operations perspective one would like to completely configure an ES node before bringing it up. Im thinking for example how to otherwise robustly prevent situations like where an index operation hits a node that hasn't got its mapping provided via the API yet. Is the idea nodes have to be "shielded" from the network until the mappings have been uploaded? Is there an easy way to prevent an ES instance from accepting operations until a template/mapping has been provided? |
@VascoVisser A node joining an existing cluster should not start accepting index/search operations until it has the necessary cluster state to perform those operation (eg knowing metadata of existing indexes). Do you have an example setup where that is not true? If so, please open a new issue and we will be happy to investigate. |
I have a single node setup, running ES from within a docker container. With 1.6 I ship the index templates with the container, allowing me to provision by just starting the container. With 2.0 I know of no other way but that I would have to make sure nothing is able to write to the a newly deployed instance, then "manually" send over the templates via the REST API, and then make the new ES instance available to clients. |
@VascoVisser file based templates and mappings have a key inherent problem: the resolution priority is undefined. What if you set a default file based mapping, and then set default in your mappings? Which one wins? What if you then restart the node? Mappings need to be exclusively part of the cluster state, so that the cluster controls how they are synchronized across the cluster as nodes go up and down. As for your problem, I don't know docker, but could you send the index template to elasticsearch during the instance startup, after elasticsearch has started? Let's move any further discussion to https://discuss.elastic.co, as this PR is closed. |
I am also disappointed that this feature was removed. Just like KlavsKlavsen, I use a file based approach so that my mappings can be place in source control. Is using source control an anti-pattern nowadays? Removing features because someone might break something is catering to newbies at the expenses of power users. We do not need kid gloves. |
@brusic this is not about kid gloves. At the stage of the project we really need to streamline approaches to maintain high quality. We are struggeling a lot with legacy code because of tons of different code-paths and ways to do the same thing. For us and I am convinced as well for the user going though the cluster and the clusterstate for things like this is superior to file based approaches. It's also less error-prone. If you use version control you can do the same thing, everytime you update your mapping just update it in the cluster and it will be consistent on all nodes. |
@s1monw, I do understand the need to reduce code paths, and I appreciate that way-of-thinking, really. |
wait, you templates are stored in the clusterstate so if a new node joins it gets the templates first and then can handle indices creation etc. I can only see a problem when you are initially starting up your cluster which is a one off? That is actually the way to go, you have all your stuff in the clusterstate and all nodes are consistent. |
I'm referring to the initial starting up of the cluster. |
The way elasticsearch should be used is non-filebased configuration. If your cluster is ready to serve index creations before it's ready you have to prevent this. I am sorry that we are complicating your env. but we have to simplify for the majority here. The common case is to have a long running cluster and startup initially is not necessarily a huge concern. |
I think that in this particular use case, a file based configuration will simplify things. Anyway, thanks for the attention and the quick response. really appreciate that! |
Using files that must be specified on each node is an anti-pattern
from the API based goal of ES. This change removes the ability
to specify the default mapping with a file on each node.
closes #10620