# How to add another node to existingt cluster

**URL:** <https://discuss.elastic.co/t/how-to-add-another-node-to-existingt-cluster/94855>\
**Category:** Elasticsearch\
**Created:** [July 27, 2017, 7:10pm UTC](https://discuss.elastic.co/t/how-to-add-another-node-to-existingt-cluster/94855 "2017-07-27T19:10:02Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![shyamalaponnada](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shyamalaponnada](https://discuss.elastic.co/u/shyamalaponnada)\
**Post date:** [July 27, 2017, 7:10pm UTC](https://discuss.elastic.co/t/how-to-add-another-node-to-existingt-cluster/94855/1 "2017-07-27T19:10:02Z")

</div>

HI,

I have already one under cluster.Now i would like to add one more to the same cluster.I have made few changes in .yml file.but still new node is not added.Please find .yml file below;

# 

# NOTE: Elasticsearch comes with reasonable defaults for most settings.

# Before you set out to tweak and tune the configuration, make sure you

# understand what are you trying to accomplish and the consequences.

# 

# The primary way of configuring a node is via this file. This template lists

# the most important settings you may want to configure for a production cluster.

# 

# Please consult the documentation for further information on configuration options:

# [https://www.elastic.co/guide/en/elasticsearch/reference/index.html](https://www.elastic.co/guide/en/elasticsearch/reference/index.html)

# 

# ---------------------------------- Cluster -----------------------------------

# 

# Use a descriptive name for your cluster:

# 

[cluster.name](http://cluster.name): Elasticsearch

# 

# ------------------------------------ Node ------------------------------------

# 

# Use a descriptive name for the node:

# 

[node.name](http://node.name): shyamala ponnada  
node.master: true  
node.data: true

# 

# Add custom attributes to the node:

# 

#node.attr.rack: r1

# 

# Use a descriptive name for the node:

# 

[node.name](http://node.name): Production  
node.master: true  
node.data: false

# 

# Add custom attributes to the node:

# 

#node.attr.rack: r2

# 

# ----------------------------------- Paths ------------------------------------

# 

# Path to directory where to store the data (separate multiple locations by comma):

# 

#path.data: /path/to/data

# 

# Path to log files:

# 

#path.logs: /path/to/logs

# 

# ----------------------------------- Memory -----------------------------------

# 

# Lock the memory on startup:

# 

# bootstrap.memory\_lock: true

# 

# Make sure that the heap size is set to about half the memory available

# on the system and that the owner of the process is allowed to use this

# limit.

# 

# Elasticsearch performs poorly when the system is swapping the memory.

# 

# ---------------------------------- Network -----------------------------------

# 

# Set the bind address to a specific IP (IPv4 or IPv6):

# 

network.host: 10.225.34.36

# 

# Set a custom port for HTTP:

# 

http.port: 9200

# 

# For more information, consult the network module documentation.

# 

# --------------------------------- 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.multicast.enabled: false  
discovery.zen.ping.unicast.hosts: ["shyamala ponnada","Production"]

# 

# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):

# 

#discovery.zen.minimum\_master\_nodes: 3

# 

# For more information, consult the zen discovery module documentation.

# 

# ---------------------------------- Gateway -----------------------------------

# 

# Block initial recovery after a full cluster restart until N nodes are started:

# 

#gateway.recover\_after\_nodes: 3

# 

# For more information, consult the gateway module documentation.

# 

# ---------------------------------- Various -----------------------------------

# 

# Require explicit names when deleting indices:

# 

#action.destructive\_requires\_name: true

# ----------------------------COR request--------------------------

http.cors.enabled : true  
http.cors.allow-origin : "\*"  
http.cors.allow-methods : OPTIONS, HEAD, GET, POST, PUT, DELETE  
http.cors.allow-headers : X-Requested-With,X-Auth-Token,Content-Type, Content-Length

Please let me i have configured correctly or not.

Thanks  
Shyamala

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 27, 2017, 7:35pm UTC](https://discuss.elastic.co/t/how-to-add-another-node-to-existingt-cluster/94855/2 "2017-07-27T19:35:32Z")

</div>

Please format your code using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will make your post more readable.

Or use markdown style like:

````
```
CODE
```
````

---

<div class="post-metadata">

**Author:** ![shyamalaponnada](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shyamalaponnada](https://discuss.elastic.co/u/shyamalaponnada)\
**Post date:** [July 27, 2017, 8:55pm UTC](https://discuss.elastic.co/t/how-to-add-another-node-to-existingt-cluster/94855/3 "2017-07-27T20:55:56Z")

</div>

HI David,

Sorry for the inconvenience

Please find the code for config.yml file..i am not sure how to mention two nodes details in one config file  
shall i maintain two config files for two nodes?

======================== Elasticsearch Configuration =========================

\</\> ---------------------------------- Cluster -----------------------------------  
\</\>  
\</\> Use a descriptive name for your cluster:  
\</\>  
[cluster.name](http://cluster.name): Elasticsearch  
\</\>  
\</\> ------------------------------------ Node1 ------------------------------------  
\</\>  
\</\> Use a descriptive name for the node:  
\</\>  
[node.name](http://node.name): shyamala ponnada  
node.master: true  
node.data: true  
\</\>  
\</\> Add custom attributes to the node:  
\</\>  
\</\>node.attr.rack: r1  
\</\>  
\</\> ------------------------------------ Node2 ------------------------------------  
\</\>  
[node.name](http://node.name): Production  
node.master: true  
node.data: false  
\</\>  
\</\> Add custom attributes to the node:  
\</\>  
\</\>node.attr.rack: r2  
\</\>  
\</\> ----------------------------------- Paths ------------------------------------  
\</\>  
\</\> Path to directory where to store the data (separate multiple locations by comma):  
\</\>  
\</\>path.data: /path/to/data  
\</\>  
\</\> Path to log files:  
\</\>  
\</\>path.logs: /path/to/logs  
\</\>  
\</\> ----------------------------------- Memory -----------------------------------  
\</\>  
\</\> Lock the memory on startup:  
\</\>  
\</\> bootstrap.memory\_lock: true  
\</\>  
\</\> Make sure that the heap size is set to about half the memory available  
\</\> on the system and that the owner of the process is allowed to use this  
\</\> limit.  
\</\>  
\</\> Elasticsearch performs poorly when the system is swapping the memory.  
\</\>  
\</\> ---------------------------------- Network -----------------------------------  
\</\>  
\</\> Set the bind address to a specific IP (IPv4 or IPv6):  
\</\>  
network.host: 10.225.34.36  
\</\>  
\</\> Set a custom port for HTTP:  
\</\>  
http.port: 9200  
\</\>  
\</\> For more information, consult the network module documentation.  
\</\>  
\</\> --------------------------------- 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.multicast.enabled: false

discovery.zen.ping.unicast.hosts: ["shyamala ponnada","Production"]

\</\>  
\</\> Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):  
\</\>  
\</\>discovery.zen.minimum\_master\_nodes: 3  
\</\>  
\</\> For more information, consult the zen discovery module documentation.  
\</\>  
\</\> ---------------------------------- Gateway -----------------------------------  
\</\>  
\</\> Block initial recovery after a full cluster restart until N nodes are started:  
\</\>  
\</\>gateway.recover\_after\_nodes: 3  
\</\>  
\</\> For more information, consult the gateway module documentation.  
\</\>  
\</\> ---------------------------------- Various -----------------------------------  
\</\>  
\</\> Require explicit names when deleting indices:  
\</\>  
\</\>action.destructive\_requires\_name: true

\</\> ----------------------------COR request--------------------------  
http.cors.enabled : true  
http.cors.allow-origin : "\*"  
http.cors.allow-methods : OPTIONS, HEAD, GET, POST, PUT, DELETE  
http.cors.allow-headers : X-Requested-With,X-Auth-Token,Content-Type, Content-Length

Thanks  
shyamala

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 28, 2017, 1:50am UTC](https://discuss.elastic.co/t/how-to-add-another-node-to-existingt-cluster/94855/4 "2017-07-28T01:50:59Z")

</div>

Please format your code.

 ![IMG_1746](https://us1.discourse-cdn.com/elastic/original/3X/e/4/e4e5d951fb462b06ed9ceddb20b8dff8f41ef661.jpg)

---

<div class="post-metadata">

**Author:** ![shyamalaponnada](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shyamalaponnada](https://discuss.elastic.co/u/shyamalaponnada)\
**Post date:** [July 28, 2017, 6:03pm UTC](https://discuss.elastic.co/t/how-to-add-another-node-to-existingt-cluster/94855/5 "2017-07-28T18:03:07Z")

</div>

```
# Use a descriptive na# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your `cluster`:
#
cluster.name: Elasticsearch
#
# ------------------------------------ Node ------------------------------------
#me for the node:
#
node.name: shyamala ponnada
node.master: true
node.data: true
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# Use a descriptive name for the node:
#
node.name: Production
node.master: true
node.data: false
#
# Add custom attributes to the node:
#
#node.attr.rack: r2
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
#path.data: /path/to/data
#
# Path to log files:
#
#path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
# bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 10.225.34.36
#
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- 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.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["shyamala ponnada","Production"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
#
#discovery.zen.minimum_master_nodes: 3
#
# For more information, consult the zen discovery module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true

# ----------------------------COR request--------------------------
http.cors.enabled : true
http.cors.allow-origin : "*"
http.cors.allow-methods : OPTIONS, HEAD, GET, POST, PUT, DELETE
http.cors.allow-headers : X-Requested-With,X-Auth-Token,Content-Type, Content-Length
```

---

<div class="post-metadata">

**Author:** ![shyamalaponnada](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shyamalaponnada](https://discuss.elastic.co/u/shyamalaponnada)\
**Post date:** [July 28, 2017, 6:04pm UTC](https://discuss.elastic.co/t/how-to-add-another-node-to-existingt-cluster/94855/6 "2017-07-28T18:04:03Z")

</div>

Please suggest me whether i am following correct path to add another node under same cluster

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 28, 2017, 7:41pm UTC](https://discuss.elastic.co/t/how-to-add-another-node-to-existingt-cluster/94855/7 "2017-07-28T19:41:57Z")

</div>

Lot of things are wrong in your settings;

- Multiple definitions of [node.xxx](http://node.xxx) attributes
- unicast list of nodes does not refer to IP or hostnames

Please remove all the commented lines as they are useless here. It will make your posts more clear.

---

<div class="post-metadata">

**Author:** ![shyamalaponnada](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shyamalaponnada](https://discuss.elastic.co/u/shyamalaponnada)\
**Post date:** [July 28, 2017, 8:04pm UTC](https://discuss.elastic.co/t/how-to-add-another-node-to-existingt-cluster/94855/8 "2017-07-28T20:04:16Z")

</div>

```
I have given the node names for **discovery.zen.ping.unicast.hosts** and i have mentioned multiple definitions for nodes as we are having two nodes 

```

-------------------------------------Cluster-------------------

```
cluster.name: Elasticsearch

------------------------------------ Node 1------------------------------------

node.name: shyamala ponnada
node.master: true
node.data: true

------------------------------------ Node 2------------------------------------

node.name: Production
node.master: true
node.data: false

---------------------------------- Network -----------------------------------

network.host: 10.225.34.36
http.port: 9200

--------------------------------- Discovery ----------------------------------

discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["shyamala ponnada","Production"]
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 28, 2017, 8:42pm UTC](https://discuss.elastic.co/t/how-to-add-another-node-to-existingt-cluster/94855/9 "2017-07-28T20:42:42Z")

</div>

As I said, this is wrong.

Please read the guide and just modify settings you know you need to modify.

Don't add duplicate settings.

Each node has its own config file.

---

<div class="post-metadata">

**Author:** ![jth1](https://avatars.discourse-cdn.com/v4/letter/j/898d66/32.png) [@jth1](https://discuss.elastic.co/u/jth1)\
**Post date:** [July 28, 2017, 9:18pm UTC](https://discuss.elastic.co/t/how-to-add-another-node-to-existingt-cluster/94855/10 "2017-07-28T21:18:32Z")

</div>

To create another node under the same cluster, start another instance of elasticsearch just like you did for first node and give the same cluster name. When you check the health status you can see number of nodes 2.

---

<div class="post-metadata">

**Author:** ![shyamalaponnada](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shyamalaponnada](https://discuss.elastic.co/u/shyamalaponnada)\
**Post date:** [July 31, 2017, 2:21pm UTC](https://discuss.elastic.co/t/how-to-add-another-node-to-existingt-cluster/94855/11 "2017-07-31T14:21:26Z")

</div>

Another instance means shall i add another config file or again i need to install elasticsearch ?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 31, 2017, 6:05pm UTC](https://discuss.elastic.co/t/how-to-add-another-node-to-existingt-cluster/94855/12 "2017-07-31T18:05:02Z")

</div>

In production, you don't want to run 2 nodes on the same physical machine. So that speaks for itself.

In dev, then you can just start a new instance (assuming you did not touch any default settings) by just running locally:

```auto
bin/elasticsearch

```

You can run OOTB up to 5 nodes locally IIRC.

---

<div class="post-metadata">

**Author:** ![shyamalaponnada](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shyamalaponnada](https://discuss.elastic.co/u/shyamalaponnada)\
**Post date:** [July 31, 2017, 6:17pm UTC](https://discuss.elastic.co/t/how-to-add-another-node-to-existingt-cluster/94855/13 "2017-07-31T18:17:31Z")

</div>

Thanks for reply David!!!!

I having one doubt.  
I have only one linux server, in that i have installed Elasticsearch and created one node1 and successfully able to send data of QA.Now i want to create node2 in the same linux server and under same cluster and would like send PROD data to second [node.So](http://node.So) how can i approach?

Please help me out?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [July 31, 2017, 6:40pm UTC](https://discuss.elastic.co/t/how-to-add-another-node-to-existingt-cluster/94855/15 "2017-07-31T18:40:20Z")

</div>

Then you need to create 2 different clusters.

```auto
bin/elasticsearch -Ecluster.name=qa

```

and

```auto
bin/elasticsearch -Ecluster.name=prod

```

Both nodes won't see each others.  
You can always use reindex from remote or snapshot/restore if you want to move data between them.

---

<div class="post-metadata">

**Author:** ![shyamalaponnada](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@shyamalaponnada](https://discuss.elastic.co/u/shyamalaponnada)\
**Post date:** [August 3, 2017, 6:42pm UTC](https://discuss.elastic.co/t/how-to-add-another-node-to-existingt-cluster/94855/16 "2017-08-03T18:42:38Z")

</div>

Thanks for reply David!!!!!

I have installed Elastic search through [RPM.As](http://RPM.As) of now i have created two instances of ES is running but when i check for count of nodes its showing only one node.I have given different port number in 2nd instance of ES.when i look for the status of Elasticsearch2(second instance of ES)i am getting below message.

```
[root@LOUSSPLQS10 share]# service elasticsearch2 status
â elasticsearch2.service - LSB: This service manages the elasticsearch daemon
   Loaded: loaded (/etc/rc.d/init.d/elasticsearch2; bad; vendor preset: disabled)
   Active: active (exited) since Thu 2017-08-03 14:16:16 EDT; 25min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1789 ExecStop=/etc/rc.d/init.d/elasticsearch2 stop (code=exited, status=0/SUCCESS)
  Process: 1793 ExecStart=/etc/rc.d/init.d/elasticsearch2 start (code=exited, status=0/SUCCESS)

Aug 03 14:16:10 LOUSSPLQS10.rsc.humad.com systemd[1]: Starting LSB: This service manages the elasticsearch daemon...
Aug 03 14:16:11 LOUSSPLQS10.rsc.humad.com runuser[1797]: pam_limits(runuser:session): invalid line 'elasticsearch nofile 65536' - skipped
Aug 03 14:16:11 LOUSSPLQS10.rsc.humad.com runuser[1797]: pam_unix(runuser:session): session opened for user elasticsearch by (uid=0)
Aug 03 14:16:16 LOUSSPLQS10.rsc.humad.com elasticsearch2[1793]: Starting elasticsearch:(node 2)[OK]
Aug 03 14:16:16 LOUSSPLQS10.rsc.humad.com elasticsearch2[1793]: touch: cannot touch â/var/lock/subsys/elasticsearch/2â: No such file or directory
Aug 03 14:16:16 LOUSSPLQS10.rsc.humad.com systemd[1]: Started LSB: This service manages the elasticsearch daemon.

```

Please help me!!!!!

Thanks  
Shyamala

---

<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:** [August 31, 2017, 6:49pm UTC](https://discuss.elastic.co/t/how-to-add-another-node-to-existingt-cluster/94855/17 "2017-08-31T18:49:29Z")

</div>

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