Skip to content
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

Change default to node.max_local_storage_nodes to 1 in "production mode" #19679

Closed
bleskes opened this issue Jul 29, 2016 · 0 comments
Closed
Assignees
Labels

Comments

@bleskes
Copy link
Contributor

bleskes commented Jul 29, 2016

Currently Elasticsearch allows starting multiple nodes using the same data path by simply starting multiple processes. This is great for the OOB experience where people can simply build clusters without too much hassle. On the other side, this has caused much confusion in real clusters where people started a node before properly shutting down the first, which looks to the outside as data loss. There are valid production use cases where we want multiple nodes on the same servers but those are rare (and mostly involve running on servers with lots of memory).

I think it is a good idea to better protect people by using our new "production mode" definition to change the default of the node.max_local_storage_nodes to 1, from the currently unbounded value.

@nik9000 nik9000 self-assigned this Aug 1, 2016
nik9000 added a commit to nik9000/elasticsearch that referenced this issue Aug 2, 2016
Defaulting `max_local_storage_nodes` to `50` is useful for testing so
this patch moves that default from "all the time" to "if you don't bind
a public ip". If you *do* bind a public IP and attempt to use more than
a single node per data directory without *explicitly* setting
`max_local_storage_nodes` then Elasticsearch will now fail to start.

Since you can't change the default for a setting depending on the
"prod-mode/non-prod-mode" flag we instead use a sentinel value (`0`) of
`max_local_storage_nodes` to mean "user didn't specify, pick it from
the "prod-mode/non-prod-mode" flag".

Since we don't know if we're in prod mode when we pick the data directory
we instead assume that we *aren't* and then check if the directory that
we picked was OK when we run the `BootstrapCheck`s. The nice thing about
doing it this way is that we warn the user if they have more than one
Elasticsearch in their data directory even if they are running even in dev
mode!

While this is the easiest way to make this change the cost is that, even
if Elasticsearch fails to start because it is in production mode and
`max_local_storage_nodes` isn't configured it'll still create a directory.

This also removes some of the documentation that suggests you override the
setting on all production clusters. That is no longer important because
Elasticsearch won't start in production mode if you try to start more
than one node.

Closes elastic#19679
@clintongormley clintongormley added the :Core/Infra/Settings Settings infrastructure and APIs label Aug 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants