# How to start two instances of ES 6.0 as a service?

**URL:** <https://discuss.elastic.co/t/how-to-start-two-instances-of-es-6-0-as-a-service/109328>\
**Category:** Elasticsearch\
**Created:** [November 28, 2017, 7:56am UTC](https://discuss.elastic.co/t/how-to-start-two-instances-of-es-6-0-as-a-service/109328 "2017-11-28T07:56:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![elastic\_paul](https://avatars.discourse-cdn.com/v4/letter/e/ebca7d/32.png) [@elastic\_paul](https://discuss.elastic.co/u/elastic_paul)\
**Post date:** [November 28, 2017, 7:56am UTC](https://discuss.elastic.co/t/how-to-start-two-instances-of-es-6-0-as-a-service/109328/1 "2017-11-28T07:56:06Z")

</div>

As an experiment I would like to run 2 instances of ES on each server - I know this is not normally recommended. My servers has 128GB RAM and 12 processors (24 cores) so I would like to try running two instances.

I have made the changes to the yml files - elasticsearch.1.yml and elasticsearch.2.yml and I have put them in their own directories with the other files

My problem is that I can not work out how to start the two instances. I am running Centos 6.9 and ES 6.0.

When I try from the command line I get permission errors - either I do not have permission or I can not run as root. In this case how should I start the two instances?

I usually use "service elasticsearch start" but to get both instances I will need a new approach?  
Thanks

---

<div class="post-metadata">

**Author:** ![poojagupta](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@poojagupta](https://discuss.elastic.co/u/poojagupta)\
**Post date:** [November 28, 2017, 8:15am UTC](https://discuss.elastic.co/t/how-to-start-two-instances-of-es-6-0-as-a-service/109328/2 "2017-11-28T08:15:06Z")

</div>

you can start the elasticsearch as a service using script ([startup.sh](http://startup.sh)) which is created in elasticsearch installation directory as:  
sh [startup.sh](http://startup.sh)  
and if there is permission issue make sure elasticsearch folder have permission  
chmod 777 /etc/elasticsearch

---

<div class="post-metadata">

**Author:** ![elastic\_paul](https://avatars.discourse-cdn.com/v4/letter/e/ebca7d/32.png) [@elastic\_paul](https://discuss.elastic.co/u/elastic_paul)\
**Post date:** [November 28, 2017, 11:16am UTC](https://discuss.elastic.co/t/how-to-start-two-instances-of-es-6-0-as-a-service/109328/3 "2017-11-28T11:16:49Z")

</div>

Thanks for your help.

One more question if I may. I am having problems with x-pack now. Do I need to configure x-pack for each instance?

And I presume I can work with only one copy of kibana running?

---

<div class="post-metadata">

**Author:** ![elastic\_paul](https://avatars.discourse-cdn.com/v4/letter/e/ebca7d/32.png) [@elastic\_paul](https://discuss.elastic.co/u/elastic_paul)\
**Post date:** [November 29, 2017, 6:13am UTC](https://discuss.elastic.co/t/how-to-start-two-instances-of-es-6-0-as-a-service/109328/4 "2017-11-29T06:13:01Z")

</div>

I have successfully finished this, so I will close this off as "solved".  
Here is a summary of things I did.

- Copied and edited files to:  
/etc/init.d/elasticsearch1  
/etc/init.d/elasticsearch2  
/etc/sysconfig/elasticsearch1  
/etc/sysconfig/elasticsearch2  
/etc/elasticseach1/config1/elasticsearch.yml  
/etc/elasticseach1/config2/elasticsearch.yml

- To start and stop the instances, I use "service elasticsearch1 start" etc

- I split my 12 disks per node between the two instances, 6 disks/pathsfor each instance

- As I have two ethernet adapters I assigned on unique IP to each instance

All working nicely and I am bulk loading in the 12,000 - 15,000/s region, being bound by the I/O on the spinning disks. Its steady and useable so I am happy.

---

<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:** [December 27, 2017, 6:13am UTC](https://discuss.elastic.co/t/how-to-start-two-instances-of-es-6-0-as-a-service/109328/5 "2017-12-27T06:13:12Z")

</div>

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