# Elasticsearch-setup-password kills elastic process

**URL:** <https://discuss.elastic.co/t/elasticsearch-setup-password-kills-elastic-process/254067>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security\
**Created:** [November 2, 2020, 6:20pm UTC](https://discuss.elastic.co/t/elasticsearch-setup-password-kills-elastic-process/254067 "2020-11-02T18:20:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![martinsz](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@martinsz](https://discuss.elastic.co/u/martinsz)\
**Post date:** [November 2, 2020, 6:20pm UTC](https://discuss.elastic.co/t/elasticsearch-setup-password-kills-elastic-process/254067/1 "2020-11-02T18:20:30Z")

</div>

Hi, I'm setting up a new cluster with security after successfully fixing it (earlier post [Help a non-profit STIR the data](https://discuss.elastic.co/t/help-a-non-profit-stir-the-data/251589)).

The difference is that I've now configured TLS on the HTTP interface, so my regular `elasticsearch-setup-passwords auto -b` doesn't work. So I added the `-E xpack.security.http.ssl.verification_mode=certificate`

This works upto about the middle of the process and then kills the elastic process, logs me out of the kubectl session and leaves me without a password for the user elastic.

This is the full output with the passwords redacted:

```auto
$ kubectl exec -it es-cluster-2 -- bash 
[root@es-cluster-2 elasticsearch]# elasticsearch-setup-passwords auto -b -E xpack.security.http.ssl.verification_mode=certificate
Changed password for user apm_system
PASSWORD apm_system = 
    
Changed password for user kibana_system
PASSWORD kibana_system = 
    
command terminated with exit code 137

```

I'm running version 7.9 with a basic license.

I did an attempt with the configuration already setup for elastic and in interactive mode, the result is the same:

```auto
$ kubectl exec -it es-cluster-0 -- elasticsearch-setup-passwords interactive -b
Enter password for [elastic]: 
Reenter password for [elastic]: 
Enter password for [apm_system]: 
Reenter password for [apm_system]: 
Enter password for [kibana_system]: 
Reenter password for [kibana_system]: 
Enter password for [logstash_system]: 
Reenter password for [logstash_system]: 
Enter password for [beats_system]: 
Reenter password for [beats_system]: 
Enter password for [remote_monitoring_user]: 
Reenter password for [remote_monitoring_user]: 
Changed password for user [apm_system]
Changed password for user [kibana_system]
Changed password for user [kibana]
command terminated with exit code 137

```

When it's about to set the elastic password, it dies. There's nothing in the logs, btw.

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [November 3, 2020, 1:34am UTC](https://discuss.elastic.co/t/elasticsearch-setup-password-kills-elastic-process/254067/2 "2020-11-03T01:34:49Z")

</div>

That looks very much like an out of memory issue - the process is being killed because it is exceeding the memory allocated to the container.

---

<div class="post-metadata">

**Author:** ![martinsz](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@martinsz](https://discuss.elastic.co/u/martinsz)\
**Post date:** [November 3, 2020, 2:19am UTC](https://discuss.elastic.co/t/elasticsearch-setup-password-kills-elastic-process/254067/3 "2020-11-03T02:19:48Z")

</div>

Hello Tim, thanks for the reply.

I have the following configuration:

```auto
          limits:
            cpu: 400m
            memory: 4G
          requests:
            cpu: 50m
            memory: 3G

```

And

```auto
        - name: ES_JAVA_OPTS
          value: -Xms3g -Xmx3g

```

Is this OK?

The ES nodes are probably running some other pods, but I would think Kubernetes takes care of this?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 3, 2020, 6:32am UTC](https://discuss.elastic.co/t/elasticsearch-setup-password-kills-elastic-process/254067/4 "2020-11-03T06:32:21Z")

</div>

The gap size should be set to no more than 50% of available RAM and you have it set far beyond that. Either increase the RAM allocated or reduce the heap size.

---

<div class="post-metadata">

**Author:** ![martinsz](https://avatars.discourse-cdn.com/v4/letter/m/a3d4f5/32.png) [@martinsz](https://discuss.elastic.co/u/martinsz)\
**Post date:** [November 3, 2020, 4:10pm UTC](https://discuss.elastic.co/t/elasticsearch-setup-password-kills-elastic-process/254067/5 "2020-11-03T16:10:52Z")

</div>

That's interecsing Christian. I don't claim to understand how this works, but what you say sounds like wasting a lot of ram. Can you point to a justification for this?

As a work-around I was able to create a new superuser using elasticsearch-users and from there I was able to login to kibana and change the elastic password from there.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [November 3, 2020, 4:13pm UTC](https://discuss.elastic.co/t/elasticsearch-setup-password-kills-elastic-process/254067/6 "2020-11-03T16:13:03Z")

</div>

Elasticsearch relies on the OS page cache for performance, so RAM is not wasted. It also stores some data structures off-heap which is why the 50% recommendation is in place. I would recommend reading [this blog post](https://www.elastic.co/blog/a-heap-of-trouble) and [the docs](https://www.elastic.co/guide/en/elasticsearch/reference/7.9/heap-size.html) for more information.

---

<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 1, 2020, 4:13pm UTC](https://discuss.elastic.co/t/elasticsearch-setup-password-kills-elastic-process/254067/7 "2020-12-01T16:13:05Z")

</div>

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