# Can't add node to a single node cluster

**URL:** <https://discuss.elastic.co/t/cant-add-node-to-a-single-node-cluster/88781>\
**Category:** Elasticsearch\
**Created:** [June 9, 2017, 3:05am UTC](https://discuss.elastic.co/t/cant-add-node-to-a-single-node-cluster/88781 "2017-06-09T03:05:02Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tamizh](https://avatars.discourse-cdn.com/v4/letter/t/8c91f0/32.png) [@Tamizh](https://discuss.elastic.co/u/Tamizh)\
**Post date:** [June 9, 2017, 3:05am UTC](https://discuss.elastic.co/t/cant-add-node-to-a-single-node-cluster/88781/1 "2017-06-09T03:05:02Z")

</div>

I am currently running a single node cluster with nginx proxy for security reason. I want to add a new node to my cluster.  
So i install elasticsearch and kibana in my new node and nginx for proxy forward. But when i modify the new node unicast variable to my master node. And after restart.  
It gives when i hit the following url

\<ip\_url\>:8000/\_cluster/health

`{"error":{"root_cause":[{"type":"master_not_discovered_exception","reason":null}],"type":"master_not_discovered_exception","reason":null},"status":503}`  
I can see elasticsearch is running when i hit \<ip\_url\>:8000

So can any one tell what am i doing wrong ??

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 10, 2017, 8:42am UTC](https://discuss.elastic.co/t/cant-add-node-to-a-single-node-cluster/88781/2 "2017-06-10T08:42:07Z")

</div>

It would probably help if you shared the Elasticsearch configuration for the two nodes. Without additional information it is virtually impossible to help.

---

<div class="post-metadata">

**Author:** ![Tamizh](https://avatars.discourse-cdn.com/v4/letter/t/8c91f0/32.png) [@Tamizh](https://discuss.elastic.co/u/Tamizh)\
**Post date:** [June 10, 2017, 2:22pm UTC](https://discuss.elastic.co/t/cant-add-node-to-a-single-node-cluster/88781/3 "2017-06-10T14:22:58Z")

</div>

Thanks for your response. These are my elasticsearch.yml. Both nodes are port forworded with nginx. For security reasons i changed the cluster name and ip addresses in the config file.

Older Node Configuration:

```
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: <Cluster Name>
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: elasticsearch-24-384-node-1
#
# Add custom attributes to the node:
#
# node.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /mnt/elastic_data/data
#
# Path to log files:
#
path.logs: /mnt/elastic_data/logs
#
# ----------------------------------- Memory -----------------------------------
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
# network.host: ["127.0.0.1"]
#
# Set a custom port for HTTP:
#
# http.port: 9200
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
# discovery.zen.ping.unicast.hosts: ["host1", "host2"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):
#
# discovery.zen.minimum_master_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html>
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
# gateway.recover_after_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html>
#
# ---------------------------------- Various -----------------------------------
#
# Disable starting multiple nodes on a single system:
#
# node.max_local_storage_nodes: 1
#
# Require explicit names when deleting indices:
#
# action.destructive_requires_name: true

```

New node configuration:

```
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: <Cluster Name>
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: elasticsearch-24-384-node-2
#
# Add custom attributes to the node:
#
# node.rack: r1
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
# network.host: ["127.0.0.1"]
#
# Set a custom port for HTTP:
#
# http.port: 9200
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.zen.ping.unicast.hosts: ["<Older-node-ip>:9300"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):
#
discovery.zen.minimum_master_nodes: 2
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html>
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
# gateway.recover_after_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html>
#
# ---------------------------------- Various ----------------------------------
```

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 10, 2017, 3:35pm UTC](https://discuss.elastic.co/t/cant-add-node-to-a-single-node-cluster/88781/4 "2017-06-10T15:35:06Z")

</div>

Network host by default binds to the loopback interface, which means that it will not be able to accept or make connections to/from other nodes. In order to form a cluster with nodes on different hosts, you need to configure Elasticsearch to bind to the IP address of the host and configure the unicast host list to connect to that same IP (on both hosts), like you have in your example. `minimum_master_nodes` should be set to 2 on both nodes (is correct on the new node).

---

<div class="post-metadata">

**Author:** ![Tamizh](https://avatars.discourse-cdn.com/v4/letter/t/8c91f0/32.png) [@Tamizh](https://discuss.elastic.co/u/Tamizh)\
**Post date:** [June 10, 2017, 4:25pm UTC](https://discuss.elastic.co/t/cant-add-node-to-a-single-node-cluster/88781/5 "2017-06-10T16:25:32Z")

</div>

Can you check new configuration and tell if there is any issue

Older Node Configuration:

```
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: <Cluster Name>
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: elasticsearch-24-384-node-1
#
# Add custom attributes to the node:
#
# node.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /mnt/elastic_data/data
#
# Path to log files:
#
path.logs: /mnt/elastic_data/logs
#
# ----------------------------------- Memory -----------------------------------
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: ["127.0.0.1", <new-node-ip>]
#
# Set a custom port for HTTP:
#
# http.port: 9200
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.zen.ping.unicast.hosts: ["127.0.0.1", "<new-node-ip>"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):
#
discovery.zen.minimum_master_nodes: 2
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html>
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
# gateway.recover_after_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html>
#
# ---------------------------------- Various -----------------------------------
#
# Disable starting multiple nodes on a single system:
#
# node.max_local_storage_nodes: 1
#
# Require explicit names when deleting indices:
#
# action.destructive_requires_name: true

```

New node configuration:

```
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: <Cluster Name>
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: elasticsearch-24-384-node-2
#
# Add custom attributes to the node:
#
# node.rack: r1
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: ["127.0.0.1", <old-node-ip>]
#
# Set a custom port for HTTP:
#
# http.port: 9200
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-network.html>
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.zen.ping.unicast.hosts: ["127.0.0.1", "<Older-node-ip>:9300"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):
#
discovery.zen.minimum_master_nodes: 2
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery.html>
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
# gateway.recover_after_nodes: 3
#
# For more information, see the documentation at:
# <http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway.html>
#
# ---------------------------------- Various ----------------------------------

```

Is there any security problem with this configuratio ?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [June 10, 2017, 4:48pm UTC](https://discuss.elastic.co/t/cant-add-node-to-a-single-node-cluster/88781/6 "2017-06-10T16:48:59Z")

</div>

Network host need to bind to the IP of the host (or 0.0.0.0) the node resides on. You can put both IP addresses in the unicast list.

---

<div class="post-metadata">

**Author:** ![Tamizh](https://avatars.discourse-cdn.com/v4/letter/t/8c91f0/32.png) [@Tamizh](https://discuss.elastic.co/u/Tamizh)\
**Post date:** [June 11, 2017, 3:00am UTC](https://discuss.elastic.co/t/cant-add-node-to-a-single-node-cluster/88781/7 "2017-06-11T03:00:55Z")

</div>

Before restart the elasticsearch how can i check wheter the given configuration will work or not. Because i gave the same configuration to my both nodes. when i restarted both, the same problem occures on both the nodes.

```
{"error":{"root_cause [{"type":"master_not_discovered_exception","reason":null}],"type":"master_not_discovered_exception","reason":null},"status":503}
```

---

<div class="post-metadata">

**Author:** ![Tamizh](https://avatars.discourse-cdn.com/v4/letter/t/8c91f0/32.png) [@Tamizh](https://discuss.elastic.co/u/Tamizh)\
**Post date:** [June 12, 2017, 1:08pm UTC](https://discuss.elastic.co/t/cant-add-node-to-a-single-node-cluster/88781/8 "2017-06-12T13:08:09Z")

</div>

My initial single node cluster storage about to finish. So i am in the situation that i have to add a new node. But whatever i am doing i can't join my new node to my current single node cluster.

So Can you tell me, what is the possible wrong config i am doing.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 10, 2017, 1:08pm UTC](https://discuss.elastic.co/t/cant-add-node-to-a-single-node-cluster/88781/9 "2017-07-10T13:08:17Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
