# Easiest way to switch ES between multiple example directories?

**URL:** <https://discuss.elastic.co/t/easiest-way-to-switch-es-between-multiple-example-directories/20208>\
**Category:** Elasticsearch\
**Created:** [October 12, 2014, 4:03pm UTC](https://discuss.elastic.co/t/easiest-way-to-switch-es-between-multiple-example-directories/20208 "2014-10-12T16:03:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexandre\_Rafalovitc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexandre_rafalovitc/32/1124_2.png) [@Alexandre\_Rafalovitc](https://discuss.elastic.co/u/Alexandre_Rafalovitc)\
**Post date:** [October 12, 2014, 4:03pm UTC](https://discuss.elastic.co/t/easiest-way-to-switch-es-between-multiple-example-directories/20208/1 "2014-10-12T16:03:14Z")

</div>

Hello,

I am building a bunch of self-contained ES examples in different  
directories. I am trying to figure out the easiest way to point ES to  
various locations with minimum absolute paths hardcoded.

Is there a way to point one variable to some sort of home for  
everything (elasticsearch.yml, logging.yml, data, logs, etc) to be  
relative to that? Or using relative directories in the  
elasticsearch.yml in a way that I could just clone that directory  
structure to a new example.

I have tried elasticsearch -Des.config and it picks up my config file  
but the default paths do not change and are still within ES's install  
directory. Relative paths also seem to be relative to the install.

I guess I can do an environmental variable as a common root, but I  
would still need to repeat that to point at my config file directly  
anyway, right? I am hoping to reduce the call to one simple command  
line to switch between examples.

Regards,  
Alex.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEFAe-HTfQoubr5v%3DzineXjmkJN7TmY0k\_qaVyYgeFTKRN-hoQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEFAe-HTfQoubr5v%3DzineXjmkJN7TmY0k_qaVyYgeFTKRN-hoQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [October 12, 2014, 9:57pm UTC](https://discuss.elastic.co/t/easiest-way-to-switch-es-between-multiple-example-directories/20208/2 "2014-10-12T21:57:56Z")

</div>

It's all absolute paths.

You could just run multiple, contained instances rather than multiple data  
dirs.

Regards,  
Mark Walkom

Infrastructure Engineer  
Campaign Monitor  
email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
web: [www.campaignmonitor.com](http://www.campaignmonitor.com)

On 13 October 2014 03:03, Alexandre Rafalovitch [arafalov@gmail.com](mailto:arafalov@gmail.com) wrote:

> Hello,
> 
> I am building a bunch of self-contained ES examples in different  
> directories. I am trying to figure out the easiest way to point ES to  
> various locations with minimum absolute paths hardcoded.
> 
> Is there a way to point one variable to some sort of home for  
> everything (elasticsearch.yml, logging.yml, data, logs, etc) to be  
> relative to that? Or using relative directories in the  
> elasticsearch.yml in a way that I could just clone that directory  
> structure to a new example.
> 
> I have tried elasticsearch -Des.config and it picks up my config file  
> but the default paths do not change and are still within ES's install  
> directory. Relative paths also seem to be relative to the install.
> 
> I guess I can do an environmental variable as a common root, but I  
> would still need to repeat that to point at my config file directly  
> anyway, right? I am hoping to reduce the call to one simple command  
> line to switch between examples.
> 
> Regards,  
> Alex.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAEFAe-HTfQoubr5v%3DzineXjmkJN7TmY0k\_qaVyYgeFTKRN-hoQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEFAe-HTfQoubr5v%3DzineXjmkJN7TmY0k_qaVyYgeFTKRN-hoQ%40mail.gmail.com)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEM624Z8cBqo6fm62TV%2B6QGM0c6x6pEvUpDY%2BfY9zsBR-B4O7Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEM624Z8cBqo6fm62TV%2B6QGM0c6x6pEvUpDY%2BfY9zsBR-B4O7Q%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Alexandre\_Rafalovitc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexandre_rafalovitc/32/1124_2.png) [@Alexandre\_Rafalovitc](https://discuss.elastic.co/u/Alexandre_Rafalovitc)\
**Post date:** [October 12, 2014, 10:32pm UTC](https://discuss.elastic.co/t/easiest-way-to-switch-es-between-multiple-example-directories/20208/3 "2014-10-12T22:32:40Z")

</div>

Thanks Mark,

I am afraid I am not entirely sure what you mean by "multiple,  
contained instances". Do you mean replicating the whole binary  
directory?

Regards,  
Alex.

Personal: [http://www.outerthoughts.com/](http://www.outerthoughts.com/) and @arafalov  
Solr resources and newsletter: [http://www.solr-start.com/](http://www.solr-start.com/) and @solrstart  
Solr popularizers community: [Sign Up | LinkedIn](https://www.linkedin.com/groups?gid=6713853)

On 12 October 2014 17:57, Mark Walkom [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com) wrote:

> It's all absolute paths.
> 
> You could just run multiple, contained instances rather than multiple data  
> dirs.
> 
> Regards,  
> Mark Walkom
> 
> Infrastructure Engineer  
> Campaign Monitor  
> email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
> web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> 
> On 13 October 2014 03:03, Alexandre Rafalovitch [arafalov@gmail.com](mailto:arafalov@gmail.com) wrote:
> 
> > Hello,
> > 
> > I am building a bunch of self-contained ES examples in different  
> > directories. I am trying to figure out the easiest way to point ES to  
> > various locations with minimum absolute paths hardcoded.
> > 
> > Is there a way to point one variable to some sort of home for  
> > everything (elasticsearch.yml, logging.yml, data, logs, etc) to be  
> > relative to that? Or using relative directories in the  
> > elasticsearch.yml in a way that I could just clone that directory  
> > structure to a new example.
> > 
> > I have tried elasticsearch -Des.config and it picks up my config file  
> > but the default paths do not change and are still within ES's install  
> > directory. Relative paths also seem to be relative to the install.
> > 
> > I guess I can do an environmental variable as a common root, but I  
> > would still need to repeat that to point at my config file directly  
> > anyway, right? I am hoping to reduce the call to one simple command  
> > line to switch between examples.
> > 
> > Regards,  
> > Alex.
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/CAEFAe-HTfQoubr5v%3DzineXjmkJN7TmY0k\_qaVyYgeFTKRN-hoQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEFAe-HTfQoubr5v%3DzineXjmkJN7TmY0k_qaVyYgeFTKRN-hoQ%40mail.gmail.com).  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAEM624Z8cBqo6fm62TV%2B6QGM0c6x6pEvUpDY%2BfY9zsBR-B4O7Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEM624Z8cBqo6fm62TV%2B6QGM0c6x6pEvUpDY%2BfY9zsBR-B4O7Q%40mail.gmail.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEFAe-HcFeCMgvDL8OF1haERybQi%3Df5\_iHoy60KsJ1r6TP5ssA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEFAe-HcFeCMgvDL8OF1haERybQi%3Df5_iHoy60KsJ1r6TP5ssA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [October 12, 2014, 10:36pm UTC](https://discuss.elastic.co/t/easiest-way-to-switch-es-between-multiple-example-directories/20208/4 "2014-10-12T22:36:01Z")

</div>

You can use the same binaries, but if you setup multiple configs pointing  
to different data directories then you can leverage -Des.config pointing to  
each config and then run multiple instances.

Regards,  
Mark Walkom

Infrastructure Engineer  
Campaign Monitor  
email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
web: [www.campaignmonitor.com](http://www.campaignmonitor.com)

On 13 October 2014 09:32, Alexandre Rafalovitch [arafalov@gmail.com](mailto:arafalov@gmail.com) wrote:

> Thanks Mark,
> 
> I am afraid I am not entirely sure what you mean by "multiple,  
> contained instances". Do you mean replicating the whole binary  
> directory?
> 
> Regards,  
> Alex.
> 
> Personal: [http://www.outerthoughts.com/](http://www.outerthoughts.com/) and @arafalov  
> Solr resources and newsletter: [http://www.solr-start.com/](http://www.solr-start.com/) and @solrstart  
> Solr popularizers community: [Sign Up | LinkedIn](https://www.linkedin.com/groups?gid=6713853)
> 
> On 12 October 2014 17:57, Mark Walkom [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com) wrote:
> 
> > It's all absolute paths.
> > 
> > You could just run multiple, contained instances rather than multiple  
> > data  
> > dirs.
> > 
> > Regards,  
> > Mark Walkom
> > 
> > Infrastructure Engineer  
> > Campaign Monitor  
> > email: [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com)  
> > web: [www.campaignmonitor.com](http://www.campaignmonitor.com)
> > 
> > On 13 October 2014 03:03, Alexandre Rafalovitch [arafalov@gmail.com](mailto:arafalov@gmail.com)  
> > wrote:
> > 
> > > Hello,
> > > 
> > > I am building a bunch of self-contained ES examples in different  
> > > directories. I am trying to figure out the easiest way to point ES to  
> > > various locations with minimum absolute paths hardcoded.
> > > 
> > > Is there a way to point one variable to some sort of home for  
> > > everything (elasticsearch.yml, logging.yml, data, logs, etc) to be  
> > > relative to that? Or using relative directories in the  
> > > elasticsearch.yml in a way that I could just clone that directory  
> > > structure to a new example.
> > > 
> > > I have tried elasticsearch -Des.config and it picks up my config file  
> > > but the default paths do not change and are still within ES's install  
> > > directory. Relative paths also seem to be relative to the install.
> > > 
> > > I guess I can do an environmental variable as a common root, but I  
> > > would still need to repeat that to point at my config file directly  
> > > anyway, right? I am hoping to reduce the call to one simple command  
> > > line to switch between examples.
> > > 
> > > Regards,  
> > > Alex.
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google  
> > > Groups  
> > > "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send  
> > > an  
> > > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > > To view this discussion on the web visit
> 
> [https://groups.google.com/d/msgid/elasticsearch/CAEFAe-HTfQoubr5v%3DzineXjmkJN7TmY0k\_qaVyYgeFTKRN-hoQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEFAe-HTfQoubr5v%3DzineXjmkJN7TmY0k_qaVyYgeFTKRN-hoQ%40mail.gmail.com)  
> .
> 
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit
> 
> [https://groups.google.com/d/msgid/elasticsearch/CAEM624Z8cBqo6fm62TV%2B6QGM0c6x6pEvUpDY%2BfY9zsBR-B4O7Q%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEM624Z8cBqo6fm62TV%2B6QGM0c6x6pEvUpDY%2BfY9zsBR-B4O7Q%40mail.gmail.com)  
> .
> 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAEFAe-HcFeCMgvDL8OF1haERybQi%3Df5\_iHoy60KsJ1r6TP5ssA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEFAe-HcFeCMgvDL8OF1haERybQi%3Df5_iHoy60KsJ1r6TP5ssA%40mail.gmail.com)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEM624ZZLmTfZy7Ztf5jEAycWmaHvV1DwMPcheiifKYhvN0Ovg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEM624ZZLmTfZy7Ztf5jEAycWmaHvV1DwMPcheiifKYhvN0Ovg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Alexandre\_Rafalovitc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexandre_rafalovitc/32/1124_2.png) [@Alexandre\_Rafalovitc](https://discuss.elastic.co/u/Alexandre_Rafalovitc)\
**Post date:** [October 12, 2014, 10:49pm UTC](https://discuss.elastic.co/t/easiest-way-to-switch-es-between-multiple-example-directories/20208/5 "2014-10-12T22:49:43Z")

</div>

But I think, that's what I am not seeing the exact clarity.  
-Des.config does not seem to affect the location of data and log  
directories. So, they have to be set individually in the  
elasticsearch.yml that the es.config points to. If I leave them as  
default, they are relative to the ES binary, that is to say -  
centralized.

I can set them as relative directories (just checked), but then they  
are relative to the directory I am running the start command from,  
which is not terribly stable unless I lock down the exact run  
sequence.

Or am I missing something?

Regards,  
Alex.

On 12 October 2014 18:36, Mark Walkom [markw@campaignmonitor.com](mailto:markw@campaignmonitor.com) wrote:

> You can use the same binaries, but if you setup multiple configs pointing to  
> different data directories then you can leverage -Des.config pointing to  
> each config and then run multiple instances.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAEFAe-H3pCV\_cH7fKJbdzR5F0PypoVK0MT8-Ek2qFNnb0aEk5A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAEFAe-H3pCV_cH7fKJbdzR5F0PypoVK0MT8-Ek2qFNnb0aEk5A%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:56am UTC](https://discuss.elastic.co/t/easiest-way-to-switch-es-between-multiple-example-directories/20208/6 "2017-07-06T00:56:37Z")

</div>


