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

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.

No.

Why do you want to do that ?

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.

I guess it's for testing then...

I'd use docker-compose to do that.

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

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