How Do I Add a Second Node?


(Kevin M.) #1

I installed Elasticsearch on Centos 6.7 using Yum and started pumping documents in (about 450K worth) and now see that my _cluster health is showing yellow. I want to add another node but want to make sure that I understand the procedure correctly. Do I have to install another instance of Elasticsearch and configure it so that it uses the same cluster name as the first one? That is, I will actually have two running instances (nodes) of Elasticsearch? If so, what if any changes do I need to make to the configuration of the first node? Thanks.

Kevin


(Magnus B├Ąck) #2

I installed Elasticsearch on Centos 6.7 using Yum and started pumping documents in (about 450K worth) and now see that my _cluster health is showing yellow.

That's expected with a single node cluster where at least one index is configured to have one or more replicas (which probably is the default in your case).

I want to add another node but want to make sure that I understand the procedure correctly. Do I have to install another instance of Elasticsearch and configure it so that it uses the same cluster name as the first one?

Yes, the cluster name must match.

That is, I will actually have two running instances (nodes) of Elasticsearch?

Yes.

If so, what if any changes do I need to make to the configuration of the first node? Thanks.

You should set the discovery.zen.ping.unicast.hosts option on each node so that it can locate the other node. With a two-node cluster you should also set the discovery.zen.minimum_master_nodes option to 2 to avoid split brain situations. Note that to get a cluster that survives even with one node down you need three nodes, not two.

https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-zen.html

Depending on what your current configuration is you may also need to adjust the network.host setting so that Elasticsearch binds to non-loopback interfaces.

https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html


(Kevin M.) #3

@magnusbaeck Thank you very much for the detailed explanation and quick response!


(system) #4