# Create multiple nodes elasticsearch 5.4

**URL:** <https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101>\
**Category:** Elasticsearch\
**Created:** [May 17, 2017, 12:33pm UTC](https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101 "2017-05-17T12:33:57Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)\
**Post date:** [May 17, 2017, 12:33pm UTC](https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101/1 "2017-05-17T12:33:57Z")

</div>

Hello

i want to create multiple nodes in single cluster in the single server

what steps i need to follow

i try many but not success yet

i am using elasticsearch 5.4

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [May 17, 2017, 2:08pm UTC](https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101/2 "2017-05-17T14:08:47Z")

</div>

At minimum, each node needs to be configured to have the same cluster name, and the unicast discovery list must include the addresses of the other nodes.

See the important settings docs here: [https://www.elastic.co/guide/en/elasticsearch/reference/current/important-settings.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/important-settings.html)

Once those are configured, you can just turn on the nodes and they will find each other and cluster.

---

<div class="post-metadata">

**Author:** ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)\
**Post date:** [May 18, 2017, 4:51am UTC](https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101/3 "2017-05-18T04:51:26Z")

</div>

I have tried both way

way 1

path:  
data: ["/usr/share/elasticsearch/data/nodes/node\_1","/usr/share/elasticsearch/data/nodes/node\_2","/usr/share/elasticsearch/data/nodes/node\_3"]  
logs: ["/var/log/elasticsearch/nodes/node\_1","/var/log/elasticsearch/nodes/node\_2","/var/log/elasticsearch/nodes/node\_3"]

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

[node.name](http://node.name): node\_1

node.max\_local\_storage\_nodes: 1

bootstrap.memory\_lock: true

network.host: 192.168.0.1

http.port: 9200

discovery.zen.ping.unicast.hosts: ["192.168.0.1:9200","192.168.0.2:9200","192.168.0.3:9200"]

discovery.zen.minimum\_master\_nodes: 2

way 2

path:  
data:

- /usr/share/elasticsearch/data/nodes/node\_1
- /usr/share/elasticsearch/data/nodes/node\_2
- /usr/share/elasticsearch/data/nodes/node\_3  
logs:
- /var/log/elasticsearch/nodes/node\_1
- /var/log/elasticsearch/nodes/node\_2
- /var/log/elasticsearch/nodes/node\_3

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

[node.name](http://node.name): node\_1

node.max\_local\_storage\_nodes: 1

bootstrap.memory\_lock: true

network.host: 192.168.0.1

http.port: 9200

discovery.zen.ping.unicast.hosts:

- 192.168.0.1:9200
- 192.168.0.2:9200
- 192.168.0.3:9200

discovery.zen.minimum\_master\_nodes: 2

but still not working can you please let me know what i am doing wrong here

---

<div class="post-metadata">

**Author:** ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)\
**Post date:** [May 18, 2017, 5:21am UTC](https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101/4 "2017-05-18T05:21:06Z")

</div>

when i run this

bash -x bin/elasticsearch

then get this error

```
 org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: unknown setting [path.logs.0] did you mean [path.logs]?

Suppressed: java.lang.IllegalArgumentException: unknown setting [path.logs.1] did you mean [path.logs]?

Suppressed: java.lang.IllegalArgumentException: unknown setting [path.logs.2] did you mean [path.logs]?
```

---

<div class="post-metadata">

**Author:** ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)\
**Post date:** [May 18, 2017, 5:40am UTC](https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101/5 "2017-05-18T05:40:02Z")

</div>

Hello i solved this error via providing the log path as string

now this is error

```
  org.elasticsearch.bootstrap.StartupException: BindTransportException[Failed to bind to [9300-9400]]; nested: BindException[Cannot assign requested address];

Caused by: java.net.BindException: Cannot assign requested address

```

this is my configuration

discovery.zen.ping.unicast.hosts:

- 192.168.0.1:9200
- 192.168.0.2:9200
- 192.168.0.3:9200

---

<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:** [May 18, 2017, 5:54am UTC](https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101/6 "2017-05-18T05:54:56Z")

</div>

If you want to start multiple nodes on the same machine (for tests purposes) just run:

```auto
bin/elasticsearch -Epath.data=data1 -Epath.logs=log1
bin/elasticsearch -Epath.data=data2 -Epath.logs=log2
bin/elasticsearch -Epath.data=data3 -Epath.logs=log3

```

Without changing anything in the default `elasticsearch.yml` and you should be done.

---

<div class="post-metadata">

**Author:** ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)\
**Post date:** [May 18, 2017, 6:02am UTC](https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101/7 "2017-05-18T06:02:33Z")

</div>

so i not need to define  
discovery.zen.ping.unicast.hosts:

---

<div class="post-metadata">

**Author:** ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)\
**Post date:** [May 18, 2017, 6:49am UTC](https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101/8 "2017-05-18T06:49:33Z")

</div>

Hello

i have tried your command as well

but this error come everytime

```
 not enough master nodes discovered during pinging (found [[Candidate{node={node_1}{MG8J5dsmTVSIiRdmz3BrSg}{9RlgCikaTPW8vOIjynaEqQ}{127.0.0.1}{127.0.0.1:9304}, clusterStateVersion=-1}]], but needed [3]), pinging again
```

---

<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:** [May 18, 2017, 7:31am UTC](https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101/9 "2017-05-18T07:31:40Z")

</div>

Did you comment all the settings in `elasticsearch.yml`?

---

<div class="post-metadata">

**Author:** ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)\
**Post date:** [May 18, 2017, 7:35am UTC](https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101/10 "2017-05-18T07:35:39Z")

</div>

path:  
data: /usr/share/elasticsearch/data/node\_1  
logs: /var/log/elasticsearch/node\_1

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

[node.name](http://node.name): node\_1  
#node.master: true ( commented )  
node.data: true  
node.max\_local\_storage\_nodes: 1  
bootstrap.memory\_lock: true  
network.host: _local_

#discovery.zen.ping.unicast.hosts: ( commented )

# - 192.168.0.1:9200 ( commented )

# - 192.168.0.2:9200 ( commented )

# - 192.168.0.3:9200 ( commented )

#discovery.zen.minimum\_master\_nodes: 10 ( commented )

but not working even when i run

bin/elasticsearch -Epath.data=/usr/share/elasticsearch/data/node\_2 -Epath.logs=/var/log/elasticsearch/node\_2

then even service not start for Query API

and how to define the name of the node via command line

can you guide the step and let me know if anything need to change and comment

---

<div class="post-metadata">

**Author:** ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)\
**Post date:** [May 18, 2017, 7:47am UTC](https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101/11 "2017-05-18T07:47:25Z")

</div>

i am also facing issue

max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

i have changed in

sudo nano /usr/lib/systemd/system/elasticsearch.service

sudo nano /etc/sysconfig/elasticsearch

sudo nano /etc/security/limits.conf

all three places but error is coming

also see this

ulimit -a  
core file size (blocks, -c) 0  
data seg size (kbytes, -d) unlimited  
scheduling priority (-e) 0  
file size (blocks, -f) unlimited  
pending signals (-i) 15090  
max locked memory (kbytes, -l) unlimited  
max memory size (kbytes, -m) unlimited  
open files (-n) 65536  
pipe size (512 bytes, -p) 8  
POSIX message queues (bytes, -q) 819200  
real-time priority (-r) 0  
stack size (kbytes, -s) 8192  
cpu time (seconds, -t) unlimited  
max user processes (-u) 15090  
virtual memory (kbytes, -v) unlimited  
file locks (-x) unlimited

what is else need to do

---

<div class="post-metadata">

**Author:** ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)\
**Post date:** [May 19, 2017, 1:48pm UTC](https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101/12 "2017-05-19T13:48:35Z")

</div>

Hello

when you run bin/elasticsearch then there are some errors

if you solve all errors then it's working fine

to add new node in the cluster

thanks  
jayram

---

<div class="post-metadata">

**Author:** ![hasan\_sharekhan](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@hasan\_sharekhan](https://discuss.elastic.co/u/hasan_sharekhan)\
**Post date:** [May 23, 2017, 1:13pm UTC](https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101/13 "2017-05-23T13:13:30Z")

</div>

I am able to run 3 nodes on same server with same setup and with 3 different config files/folders sharing common cluster name

node-0: default node, config file path: `${ES_HOME}/config` (no changes in elasticsearch.yml file)

node-1: 1st extra node, config file path: `${ES_HOME}/config/config_node1`

node-2: 2nd extra node, config file path: `${ES_HOME}/config/config_node2`

Below are the changes I made in elasticsearch.yml node1 and node2

elasticsearch.yml for node-1

> node.name: node-1  
> path.data: ${ES\_HOME}/data\_node1  
> path.logs: ${ES\_HOME}/logs/logs\_node1  
> http.port: 9201

elasticsearch.yml for node-2

> node.name: node-2  
> path.data: ${ES\_HOME}/data\_node2  
> path.logs: ${ES\_HOME}/logs/logs\_node2  
> http.port: 9202

command for starting all 3 nodes  
node-0 (it will take default config folder,no need to specify)

> elasticsearch.bat

node-1

> elasticsearch.bat -Epath.conf=${ES\_HOME}/config/config\_node1

node-2

> elasticsearch.bat -Epath.conf=${ES\_HOME}/config/config\_node2

All 3 nodes are running fine verified in [ElasticHQ](http://www.elastichq.org/) too

---

<div class="post-metadata">

**Author:** ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)\
**Post date:** [May 24, 2017, 8:29am UTC](https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101/14 "2017-05-24T08:29:35Z")

</div>

Hello i have tried your code

this error occurred for me

`ERROR: no log4j2.properties found; tried [/etc/elasticsearch/nodes/node_2.yml] and its subdirectories`

can you let me know what is your directory structure with file names

i am using elasticsearch5.4

---

<div class="post-metadata">

**Author:** ![hasan\_sharekhan](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@hasan\_sharekhan](https://discuss.elastic.co/u/hasan_sharekhan)\
**Post date:** [May 24, 2017, 11:41am UTC](https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101/15 "2017-05-24T11:41:15Z")

</div>

I have put two separate log4j2.properties and jvm.option file in both config folder

and for log4j2.properties it will take it from config folder automatically

for jvm.option file please check this post -

> [@Custom jvm.options in ElasticSearch for multinode configuration](https://discuss.elastic.co/t/custom-jvm-options-in-elasticsearch-for-multinode-configuration/86896/2):
>
> After checking elasticsearch.bat found that it is required to be set in path set ES\_JVM\_OPTIONS=d:\elasticsearch540\config\_node2\jvm.options

---

<div class="post-metadata">

**Author:** ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)\
**Post date:** [May 24, 2017, 12:08pm UTC](https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101/16 "2017-05-24T12:08:11Z")

</div>

which version on elasticsearch you are using

i am on 5.4 and that's not working for me

---

<div class="post-metadata">

**Author:** ![hasan\_sharekhan](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@hasan\_sharekhan](https://discuss.elastic.co/u/hasan_sharekhan)\
**Post date:** [May 24, 2017, 12:25pm UTC](https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101/17 "2017-05-24T12:25:56Z")

</div>

I am also running 5.4.0

Try to start all instances by opening the new cmd prompt and before starting each node set `ES_JVM_OPTIONS` in `path`, and also pass for `path.conf` excluding for master node which doesn't require `ES_JVM_OPTIONS` and `path.conf` to be set/passed

for starting node1

> set ES\_JVM\_OPTIONS=d:/uat/elasticsearch540/config\_node1/jvm.options  
> elasticsearch.bat -Epath.conf=${ES\_HOME}/config\_node1

for starting node2

> set ES\_JVM\_OPTIONS=d:/uat/elasticsearch540/config\_node2/jvm.options  
> elasticsearch.bat -Epath.conf=${ES\_HOME}/config\_node2

`ES_JVM_OPTIONS` is used by `elasticsearch.bat` and the path specified in `path.conf` will be used for reading `elasticsearch.yml` and `log4j properties` file.

I am running 3 nodes perfectly fine.

---

<div class="post-metadata">

**Author:** ![pjayramkumar](https://avatars.discourse-cdn.com/v4/letter/p/48db29/32.png) [@pjayramkumar](https://discuss.elastic.co/u/pjayramkumar)\
**Post date:** [May 24, 2017, 12:27pm UTC](https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101/18 "2017-05-24T12:27:30Z")

</div>

i added three node via command

but when i reboot the server then only master is there other are left

do you have any suggestion about that

---

<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:** [May 24, 2017, 12:42pm UTC](https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101/19 "2017-05-24T12:42:55Z")

</div>

That's the same thread as

> [@When add new node in elasticsearch 5.4 old node deleted](https://discuss.elastic.co/t/when-add-new-node-in-elasticsearch-5-4-old-node-deleted/86436):
>
> Hello I created a node via command as elasticsearch user in server here is command bin/elasticsearch -Epath.data=/usr/share/elasticsearch/data/node\_3 -Epath.logs=/var/log/elasticsearch/node\_3 -Enode.name=fan then it's showing fine then i add another via command bin/elasticsearch -Epath.data=/usr/share/elasticsearch/data/node\_4 -Epath.logs=/var/log/elasticsearch/node\_4 -Enode.name=fan\_1 then fan is remove when i fire query like this curl -XGET '[http://localhost:9200/\_cluster/state?pretty](http://localhost:9200/_cluster/state?pretty)' …

No need to discuss this in multiple places.

---

<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:** [June 21, 2017, 12:43pm UTC](https://discuss.elastic.co/t/create-multiple-nodes-elasticsearch-5-4/86101/20 "2017-06-21T12:43:13Z")

</div>

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