Multipe keystores on the same machine

(Thomas Doman) #1

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.

(Russ Cam) #2

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 in the bin directory if you're interested in the details.

(Thomas Doman) #3

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!

(system) #4

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