add-nodes.asciidoc 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. [[add-elasticsearch-nodes]]
  2. == Adding nodes to your cluster
  3. When you start an instance of {es}, you are starting a _node_. An {es} _cluster_
  4. is a group of nodes that have the same `cluster.name` attribute. As nodes join
  5. or leave a cluster, the cluster automatically reorganizes itself to evenly
  6. distribute the data across the available nodes.
  7. If you are running a single instance of {es}, you have a cluster of one node.
  8. All primary shards reside on the single node. No replica shards can be
  9. allocated, therefore the cluster state remains yellow. The cluster is fully
  10. functional but is at risk of data loss in the event of a failure.
  11. image::setup/images/elas_0202.png["A cluster with one node and three primary shards"]
  12. You add nodes to a cluster to increase its capacity and reliability. By default,
  13. a node is both a data node and eligible to be elected as the master node that
  14. controls the cluster. You can also configure a new node for a specific purpose,
  15. such as handling ingest requests. For more information, see
  16. <<modules-node,Nodes>>.
  17. When you add more nodes to a cluster, it automatically allocates replica shards.
  18. When all primary and replica shards are active, the cluster state changes to
  19. green.
  20. image::setup/images/elas_0204.png["A cluster with three nodes"]
  21. You can run multiple nodes on your local machine in order to experiment with how
  22. an {es} cluster of multiple nodes behaves. To add a node to a cluster running on
  23. your local machine:
  24. . Set up a new {es} instance.
  25. . Specify the name of the cluster with the `cluster.name` setting in
  26. `elasticsearch.yml`. For example, to add a node to the `logging-prod` cluster,
  27. add the line `cluster.name: "logging-prod"` to `elasticsearch.yml`.
  28. . Start {es}. The node automatically discovers and joins the specified cluster.
  29. To add a node to a cluster running on multiple machines, you must also
  30. <<unicast.hosts,set `discovery.seed_hosts`>> so that the new node can discover
  31. the rest of its cluster.
  32. For more information about discovery and shard allocation, see
  33. <<modules-discovery>> and <<modules-cluster>>.