mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-07 21:48:39 +00:00
69b78f7f8a
The introductory sections of the reference manual contains some simplified instructions for adding a node to the cluster. Unfortunately they are a little too simplified and only really work for clusters running on `localhost`. If you try and follow these instructions for a distributed cluster then the new node will, confusingly, auto-bootstrap itself into a distinct one-node cluster. Multiple nodes running on localhost is a valid config, of course, but we should spell out that these instructions are really only for experimentation and that it takes a bit more work to add nodes to a distributed cluster. This commit does so. Also, the "important config" instructions for discovery say that you MUST set `discovery.seed_hosts` whereas in fact it is fine to ignore this setting and use a dynamic discovery mechanism instead. This commit weakens this statement and links to the docs for dynamic discovery mechanisms. Finally, this section is also overloaded with some technical details that are not important for this context and are adequately covered elsewhere, and completely fails to note that the default discovery port is 9300. This commit addresses this.
44 lines
2.0 KiB
Plaintext
44 lines
2.0 KiB
Plaintext
[[add-elasticsearch-nodes]]
|
|
== Adding nodes to your cluster
|
|
|
|
When you start an instance of {es}, you are starting a _node_. An {es} _cluster_
|
|
is a group of nodes that have the same `cluster.name` attribute. As nodes join
|
|
or leave a cluster, the cluster automatically reorganizes itself to evenly
|
|
distribute the data across the available nodes.
|
|
|
|
If you are running a single instance of {es}, you have a cluster of one node.
|
|
All primary shards reside on the single node. No replica shards can be
|
|
allocated, therefore the cluster state remains yellow. The cluster is fully
|
|
functional but is at risk of data loss in the event of a failure.
|
|
|
|
image::setup/images/elas_0202.png["A cluster with one node and three primary shards"]
|
|
|
|
You add nodes to a cluster to increase its capacity and reliability. By default,
|
|
a node is both a data node and eligible to be elected as the master node that
|
|
controls the cluster. You can also configure a new node for a specific purpose,
|
|
such as handling ingest requests. For more information, see
|
|
<<modules-node,Nodes>>.
|
|
|
|
When you add more nodes to a cluster, it automatically allocates replica shards.
|
|
When all primary and replica shards are active, the cluster state changes to
|
|
green.
|
|
|
|
image::setup/images/elas_0204.png["A cluster with three nodes"]
|
|
|
|
You can run multiple nodes on your local machine in order to experiment with how
|
|
an {es} cluster of multiple nodes behaves. To add a node to a cluster running on
|
|
your local machine:
|
|
|
|
. Set up a new {es} instance.
|
|
. Specify the name of the cluster with the `cluster.name` setting in
|
|
`elasticsearch.yml`. For example, to add a node to the `logging-prod` cluster,
|
|
add the line `cluster.name: "logging-prod"` to `elasticsearch.yml`.
|
|
. Start {es}. The node automatically discovers and joins the specified cluster.
|
|
|
|
To add a node to a cluster running on multiple machines, you must also
|
|
<<unicast.hosts,set `discovery.seed_hosts`>> so that the new node can discover
|
|
the rest of its cluster.
|
|
|
|
For more information about discovery and shard allocation, see
|
|
<<modules-discovery>> and <<modules-cluster>>.
|