# Elasticsearch, which path for elasticsearch.keystore is used?

**URL:** <https://discuss.elastic.co/t/elasticsearch-which-path-for-elasticsearch-keystore-is-used/252845>\
**Category:** Elasticsearch\
**Created:** [October 21, 2020, 1:42pm UTC](https://discuss.elastic.co/t/elasticsearch-which-path-for-elasticsearch-keystore-is-used/252845 "2020-10-21T13:42:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrea\_Marchi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrea_marchi/32/77273_2.png) [@Andrea\_Marchi](https://discuss.elastic.co/u/Andrea_Marchi)\
**Post date:** [October 21, 2020, 1:42pm UTC](https://discuss.elastic.co/t/elasticsearch-which-path-for-elasticsearch-keystore-is-used/252845/1 "2020-10-21T13:42:27Z")

</div>

I'm trying to understand why I get 401 after initializing a new instance (goal to have multiple instances on one machine).

Steps taken:

- created a elasticsearch.keystore
- add the `bootstrap.password` successfully, with `cat ~/.elk.secret | /opt/elasticsearch/bin/elasticsearch-keystore add -x 'bootstrap.password'`
- Since I've **multiple instances running** , I **move** it in the **new conf directory**

but now I get 401:

```auto
 curl -X GET 'https://elastic:myFancyPass@myServer:9200/_cluster/health?pretty' -k
{
  "error" : {
    "root_cause" : [
      {
        "type" : "security_exception",
        "reason" : "unable to authenticate user [elastic] for REST request [/_cluster/health?pretty]",
        "header" : {
          "WWW-Authenticate" : [
            "Bearer realm=\"security\"",
            "ApiKey",
            "Basic realm=\"security\" charset=\"UTF-8\""
          ]
        }
      }
    ],
    "type" : "security_exception",
    "reason" : "unable to authenticate user [elastic] for REST request [/_cluster/health?pretty]",
    "header" : {
      "WWW-Authenticate" : [
        "Bearer realm=\"security\"",
        "ApiKey",
        "Basic realm=\"security\" charset=\"UTF-8\""
      ]
    }
  },
  "status" : 401
}

```

My understanding is that this error can be caused by two things:

- wrong password (which I doubt it's my case)
- wrong elasticsearch.file

How do I find which **elasticsearch.keystore it is loading**?

Running `rootLogger.level = debug` didn't help. I feel it would be great getting a confirmation such as `/opt/elasticsearch/instance2/conf/elasticsearch.keystore`

---

<div class="post-metadata">

**Author:** ![ikakavas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikakavas/32/34430_2.png) [@ikakavas](https://discuss.elastic.co/u/ikakavas)\
**Post date:** [October 21, 2020, 8:04pm UTC](https://discuss.elastic.co/t/elasticsearch-which-path-for-elasticsearch-keystore-is-used/252845/2 "2020-10-21T20:04:41Z")

</div>

How are you installing elasticsearch ? The keystore is picked up from `$ES_PATH_CONF` which defaults to `$ES_HOME/config`

When you start up your node, you'll see a line similar to

```auto
[2020-10-21T22:21:59,947][INFO][o.e.n.Node] [cecilia] JVM arguments

```

which contains an `-Des.path.conf=` that should point to the dir where your keystore is read from.

---

<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:** [November 18, 2020, 8:05pm UTC](https://discuss.elastic.co/t/elasticsearch-which-path-for-elasticsearch-keystore-is-used/252845/3 "2020-11-18T20:05:03Z")

</div>

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