Elasticsearch comes with a set of defaults that provide a good out of the box experience for development. The implicit statement there is that it is not necessarily great for production, which must be tailored for your own needs and therefore cannot be predicted.
The default settings make it easy to download and run multiple nodes on the same machine without any configuration changes.
Inside each installation of Elasticsearch is a
config/elasticsearch.yml. That is where the following settings live:
true, it means that the node is an eligible master node and it can be the elected master node.
true, meaning every node is an eligible master node.
true, it means that the node stores data and handles search activity.
datawill be created for you as a peer directory to
configinside of the Elasticsearch directory.
_local_, which is effectively
network.bind_host, this should be the one host that is intended to be used for inter-node communication.
(M / 2) + 1where
Mis the number of eligible master nodes (nodes using
node.master: trueimplicitly or explicitly).
1, which only is valid for a single node cluster!
network.publish_hostof those other nodes.
localhost, which means it only looks on the local machine for a cluster to join.
Elasticsearch provides three different types of settings:
Depending on the setting, it can be:
Always check the documentation for your version of Elasticsearch for what you can or cannot do with a setting.
You can set settings a few ways, some of which are not suggested:
In Elasticsearch 1.x and 2.x, you can submit most settings as Java System Properties prefixed with
$ bin/elasticsearch -Des.cluster.name=my_cluster -Des.node.name=`hostname`
In Elasticsearch 5.x, this changes to avoid using Java System Properties, instead using a custom argument type with
-E taking the place of
$ bin/elasticsearch -Ecluster.name=my_cluster -Enode.name=`hostname`
This approach to applying settings works great when using tools like Puppet, Chef, or Ansible to start and stop the cluster. However it works very poorly when doing it manually.
The order that settings are applied are in the order of most dynamic:
If the setting is set twice, once at any of those levels, then the highest level takes effect.