# Run multiple nodes on one machine

**URL:** <https://discuss.elastic.co/t/run-multiple-nodes-on-one-machine/27462>\
**Category:** Elasticsearch\
**Created:** [August 16, 2015, 11:26pm UTC](https://discuss.elastic.co/t/run-multiple-nodes-on-one-machine/27462 "2015-08-16T23:26:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mockiemockiz](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@mockiemockiz](https://discuss.elastic.co/u/mockiemockiz)\
**Post date:** [August 16, 2015, 11:26pm UTC](https://discuss.elastic.co/t/run-multiple-nodes-on-one-machine/27462/1 "2015-08-16T23:26:36Z")

</div>

Hi, I'm learning elasticsearch and trying to run multiple nodes or 2 services of elasticsearch. the both work smoothly but the both use the same config file even I already point the another one to use different config file.

this is the output of node info:

> <https://gist.github.com/mockiemockiz/738f7b81ec5099b3d8f6>

as you can see above (the gist link) :

```
"config.ignore_system_properties": "true",
"config": "/etc/elasticsearch/elasticsearch1.yml",

```

but it seems the node ignores /etc/elasticsearch/elasticsearch1.yml file and keep using /etc/elasticsearch/elasticsearch.yml.

/etc/init.d/elasticsearch1

> <https://gist.github.com/anonymous/0b8e21b46909b46f2cab>

and please take a look for these code/output:

> <https://gist.github.com/mockiemockiz/4da8aaf76b4fffc66258#file-elasticsearch>

I'm using ubuntu 14.04 LTS

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 16, 2015, 11:59pm UTC](https://discuss.elastic.co/t/run-multiple-nodes-on-one-machine/27462/2 "2015-08-16T23:59:03Z")

</div>

Try adding `set -x` to the top of the script and it'll provide some level of debugging, then you can see if your `$NODE` variable is being correctly set.

---

<div class="post-metadata">

**Author:** ![mockiemockiz](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@mockiemockiz](https://discuss.elastic.co/u/mockiemockiz)\
**Post date:** [August 17, 2015, 12:56am UTC](https://discuss.elastic.co/t/run-multiple-nodes-on-one-machine/27462/3 "2015-08-17T00:56:15Z")

</div>

ooh i forgot to tell you I already debug it and this is the output

start-stop-daemon --start -b --user "elasticsearch" -c "elasticsearch" --pidfile "/var/run/elasticsearch1.pid" --exec  
/usr/share/elasticsearch/bin/elasticsearch -- -d -p /var/run/elasticsearch1.pid --  
default.config=/etc/elasticsearch/elasticsearch1.yml  
--default.path.home=/usr/share/elasticsearch  
--default.path.logs=/var/log/elasticsearch1  
--default.path.data=/var/lib/elasticsearch1  
--default.path.work=/tmp/elasticsearch  
--default.path.conf=/etc/elasticsearch

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [August 17, 2015, 1:31am UTC](https://discuss.elastic.co/t/run-multiple-nodes-on-one-machine/27462/4 "2015-08-17T01:31:32Z")

</div>

Looking at the `_nodes` output;

```auto
  "config.ignore_system_properties": "true",
  "config": "/etc/elasticsearch/elasticsearch.yml",

```

And;

```auto
  "config.ignore_system_properties": "true",
  "config": "/etc/elasticsearch/elasticsearch1.yml",

```

They appear to be different?

---

<div class="post-metadata">

**Author:** ![mockiemockiz](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@mockiemockiz](https://discuss.elastic.co/u/mockiemockiz)\
**Post date:** [August 17, 2015, 1:43am UTC](https://discuss.elastic.co/t/run-multiple-nodes-on-one-machine/27462/5 "2015-08-17T01:43:50Z")

</div>

is it because I run two instance of elasticsearch?

1. sudo service elasticsearch start which is use /etc/elasticsearch/elasticsearch.yml config

2. sudo service elasticsearch1 start which is use /etc/elasticsearch/elasticsearch1.yml config

they appear different but when I open localhost:9200/plugin/\_head it tell me the both have the same name "Node client balancer" (read from /etc/elasticsearch/elasticsearch.yml and ignore /etc/elasticsearch/elasticsearch1.yml).

but when I click the second node info, it show up like this [https://gist.github.com/mockiemockiz/738f7b81ec5099b3d8f6](https://gist.github.com/mockiemockiz/738f7b81ec5099b3d8f6)

Hello I edited my question and I added some links to the files

---

<div class="post-metadata">

**Author:** ![mockiemockiz](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@mockiemockiz](https://discuss.elastic.co/u/mockiemockiz)\
**Post date:** [August 18, 2015, 5:59pm UTC](https://discuss.elastic.co/t/run-multiple-nodes-on-one-machine/27462/6 "2015-08-18T17:59:26Z")

</div>

so sad this forum is a bit quiet. I solved my proble by setting up ES\_JAVA\_OPTS variable in init.d file script like this:

> ES\_JAVA\_OPTS="-Des.config=/etc/elasticsearch/elasticsearch1.yml"

I have no idea why setting up CONF\_FILE=$CONF\_DIR/elasticsearch1.yml doesn't work even if the node info says

> "config": "/etc/elasticsearch/elasticsearch1.yml".

hope that helps I was struggling one week to solve this.

---

<div class="post-metadata">

**Author:** ![json](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/json/32/4125_2.png) [@json](https://discuss.elastic.co/u/json)\
**Post date:** [August 18, 2015, 7:49pm UTC](https://discuss.elastic.co/t/run-multiple-nodes-on-one-machine/27462/7 "2015-08-18T19:49:27Z")

</div>

> [@mockiemockiz](#):
>
> show original

Thank you for posting the solution. Configuring '-Des.config=/path/to/es/config' is the way.

---

<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 5, 2017, 11:55pm UTC](https://discuss.elastic.co/t/run-multiple-nodes-on-one-machine/27462/8 "2017-07-05T23:55:12Z")

</div>


