# Multipe keystores on the same machine

**URL:** <https://discuss.elastic.co/t/multipe-keystores-on-the-same-machine/136578>\
**Category:** Elasticsearch\
**Created:** [June 19, 2018, 10:37pm UTC](https://discuss.elastic.co/t/multipe-keystores-on-the-same-machine/136578 "2018-06-19T22:37:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_Doman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomas_doman/32/11409_2.png) [@Thomas\_Doman](https://discuss.elastic.co/u/Thomas_Doman)\
**Post date:** [June 19, 2018, 10:37pm UTC](https://discuss.elastic.co/t/multipe-keystores-on-the-same-machine/136578/1 "2018-06-19T22:37:01Z")

</div>

ES: 6.1.1  
OS: Microsoft Windows Server 2016 Datacenter

I'm running two different clusters on 3 VMs where the two clusters share only the computing space and the C: drive where the executables are located. Each node instances has it's own `elasticsearch.keystore`. When I call `bin\elasticsearch-keystore list`, it lists the keys I've added which seem to work for the desired instance but how is it deciding which `elasticsearch.keystore` to use and, most importantly, how do I configure the `elasticsearch.keystore` for the other instance? In my case, I'd be happy with them having the same keys and values but I'd assume that's not always the case so there must be a way to configure them separately. I checked the batch expecting to see that I could, perhaps, specify the service ID but that's not the case.

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [June 20, 2018, 1:47am UTC](https://discuss.elastic.co/t/multipe-keystores-on-the-same-machine/136578/2 "2018-06-20T01:47:52Z")

</div>

The keystore to use is determined from `ES_PATH_CONF` environment variable, which points to an Elasticsearch config directory.

If no value is explicitly set for `ES_PATH_CONF`, then a value will be inferred from `ES_HOME` environment variable, which points to the root directory of an Elasticsearch installation and may be inferred from the location from which `elasticsearch-keystore.bat` file is being run. Take a look at [`elasticsearch-env.bat`](https://github.com/elastic/elasticsearch/blob/master/distribution/src/bin/elasticsearch-env.bat) in the `bin` directory if you're interested in the details.

---

<div class="post-metadata">

**Author:** ![Thomas\_Doman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomas_doman/32/11409_2.png) [@Thomas\_Doman](https://discuss.elastic.co/u/Thomas_Doman)\
**Post date:** [June 20, 2018, 6:05pm UTC](https://discuss.elastic.co/t/multipe-keystores-on-the-same-machine/136578/3 "2018-06-20T18:05:09Z")

</div>

Thanks for that detail @forloop, I had really only confused myself by having the same keys in the disparate stores and so it didn't appear that it mattered where I was running the `elasticsearch-keystore.bat` from. So I added a test key to one and verified it indeed infers from the location where the batch file is running (cuz I don't have any envs set).

Thanks again!

---

<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 18, 2018, 6:05pm UTC](https://discuss.elastic.co/t/multipe-keystores-on-the-same-machine/136578/4 "2018-07-18T18:05:10Z")

</div>

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