# How to create multiple nodes in cluster without running separate command for each node?

**URL:** <https://discuss.elastic.co/t/how-to-create-multiple-nodes-in-cluster-without-running-separate-command-for-each-node/223248>\
**Category:** Elasticsearch\
**Created:** [March 12, 2020, 5:12am UTC](https://discuss.elastic.co/t/how-to-create-multiple-nodes-in-cluster-without-running-separate-command-for-each-node/223248 "2020-03-12T05:12:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cravinder489](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cravinder489/32/62858_2.png) [@cravinder489](https://discuss.elastic.co/u/cravinder489)\
**Post date:** [March 12, 2020, 5:12am UTC](https://discuss.elastic.co/t/how-to-create-multiple-nodes-in-cluster-without-running-separate-command-for-each-node/223248/1 "2020-03-12T05:12:57Z")

</div>

I want to add 5 nodes (on the same machine) to my elasticsearch cluster. I have done that by running separate commands for all five nodes as:

> elasticsearch -Epath.data=data1 -Epath.logs=log1  
> elasticsearch -Epath.data=data2 -Epath.logs=log2  
> elasticsearch -Epath.data=data3 -Epath.logs=log3  
> elasticsearch -Epath.data=data4 -Epath.logs=log4  
> elasticsearch -Epath.data=data5 -Epath.logs=log5

Is there any way so that I don't have to run commands for each node separately and 5 nodes are created by default whenever I run my elasticsearch batch file?

Can I achieve this by making some changes to my elasticsearch.yml file?

Currently, everything in my elasticsearch.yml file is commented.

---

<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:** [March 12, 2020, 5:57am UTC](https://discuss.elastic.co/t/how-to-create-multiple-nodes-in-cluster-without-running-separate-command-for-each-node/223248/2 "2020-03-12T05:57:25Z")

</div>

> [@cravinder489](#):
>
> Is there any way so that I don't have to run commands for each node separately and 5 nodes are created by default whenever I run my elasticsearch batch file?

No.

> [@cravinder489](#):
>
> I want to add 5 nodes (on the same machine) to my elasticsearch cluster.

Why do you want to do that ?

---

<div class="post-metadata">

**Author:** ![cravinder489](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cravinder489/32/62858_2.png) [@cravinder489](https://discuss.elastic.co/u/cravinder489)\
**Post date:** [March 12, 2020, 6:26am UTC](https://discuss.elastic.co/t/how-to-create-multiple-nodes-in-cluster-without-running-separate-command-for-each-node/223248/3 "2020-03-12T06:26:01Z")

</div>

Thank You David for helping me out.

I'm doing an internship right now and my mentor asked me if we can do something like that. He didn't tell me what we want to do by creating so many nodes.

---

<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:** [March 12, 2020, 8:15am UTC](https://discuss.elastic.co/t/how-to-create-multiple-nodes-in-cluster-without-running-separate-command-for-each-node/223248/4 "2020-03-12T08:15:48Z")

</div>

I guess it's for testing then...

I'd use docker-compose to do that.

---

<div class="post-metadata">

**Author:** ![cravinder489](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cravinder489/32/62858_2.png) [@cravinder489](https://discuss.elastic.co/u/cravinder489)\
**Post date:** [March 12, 2020, 8:18am UTC](https://discuss.elastic.co/t/how-to-create-multiple-nodes-in-cluster-without-running-separate-command-for-each-node/223248/5 "2020-03-12T08:18:44Z")

</div>

Thank You David for suggesting the tool.  
I'll search for it and will try to work with it.

---

<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:** [April 9, 2020, 8:18am UTC](https://discuss.elastic.co/t/how-to-create-multiple-nodes-in-cluster-without-running-separate-command-for-each-node/223248/6 "2020-04-09T08:18:48Z")

</div>

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