# Issue with too little memory, running several docker container (including Elasticsearch)

**URL:** <https://discuss.elastic.co/t/issue-with-too-little-memory-running-several-docker-container-including-elasticsearch/259913>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [December 30, 2020, 7:30pm UTC](https://discuss.elastic.co/t/issue-with-too-little-memory-running-several-docker-container-including-elasticsearch/259913 "2020-12-30T19:30:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lochr](https://avatars.discourse-cdn.com/v4/letter/l/ed8c4c/32.png) [@lochr](https://discuss.elastic.co/u/lochr)\
**Post date:** [December 30, 2020, 7:30pm UTC](https://discuss.elastic.co/t/issue-with-too-little-memory-running-several-docker-container-including-elasticsearch/259913/1 "2020-12-30T19:30:45Z")

</div>

Hello everyone,

I have an issue with the environment variable `discovery.type=single-node` when spinning up an Elasticsearch container via docker-compose:

Sample docker-compose file as follows:

```auto
    elasticsearch:
      image: docker.elastic.co/elasticsearch/elasticsearch:7.10.1
      restart: always
      environment:
        - discovery.type=single-node
        - bootstrap.memory_lock=true
        - network.host=0.0.0.0
        - "ES_JAVA_OPTS=-Xms2g -Xmx2g"
      ulimits:
        memlock:
          soft: -1
          hard: -1

```

The expected result would be a running single-node docker container. What actually happens is that I get `"ERROR: [1] bootstrap checks failed [1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured"` as error message and the Docker container restarts unsuccessfully. When I add the `discovery.type=single-node` in the elasticsearch.yml and run the container manually, everything works fine.

EDIT: The error message has nothing to do with the problem. It was caused by manually debugging the issue.

Do you have any suggestions, how can debug this problem further?

Best  
lochr

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [December 30, 2020, 7:55pm UTC](https://discuss.elastic.co/t/issue-with-too-little-memory-running-several-docker-container-including-elasticsearch/259913/2 "2020-12-30T19:55:08Z")

</div>

> [@lochr](#):
>
> `at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured`

Why not set at least one of these settings as the message suggests?

---

<div class="post-metadata">

**Author:** ![lochr](https://avatars.discourse-cdn.com/v4/letter/l/ed8c4c/32.png) [@lochr](https://discuss.elastic.co/u/lochr)\
**Post date:** [December 30, 2020, 8:12pm UTC](https://discuss.elastic.co/t/issue-with-too-little-memory-running-several-docker-container-including-elasticsearch/259913/3 "2020-12-30T20:12:14Z")

</div>

I did that (although I according to the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-settings.html) 127.0.0.1 should be the default):

```auto
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.10.1
    restart: always
    environment:
      - discovery.type=single-node
      - discovery.seed_hosts=127.0.0.1
      - bootstrap.memory_lock=true
      - network.host=0.0.0.0
      - "ES_JAVA_OPTS=-Xms2g -Xmx2g"
    ulimits:
      memlock:
        soft: -1
        hard: -1

```

The container does not boot anyway.

---

<div class="post-metadata">

**Author:** ![lochr](https://avatars.discourse-cdn.com/v4/letter/l/ed8c4c/32.png) [@lochr](https://discuss.elastic.co/u/lochr)\
**Post date:** [December 30, 2020, 8:32pm UTC](https://discuss.elastic.co/t/issue-with-too-little-memory-running-several-docker-container-including-elasticsearch/259913/4 "2020-12-30T20:32:18Z")

</div>

Problem solved. It was a side-effect of too many docker container with too little available memory. This was not an issue when running the isolated Elasticsearch container.

The other error message came when running the isolated Elasticsearch docker container manually, without the `discovery.type` parameter set.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [December 30, 2020, 8:37pm UTC](https://discuss.elastic.co/t/issue-with-too-little-memory-running-several-docker-container-including-elasticsearch/259913/5 "2020-12-30T20:37:25Z")

</div>

> [@lochr](#):
>
> It was a side-effect of too many docker container with too little available memory. This was not an issue when running the isolated Elasticsearch container.

For the sake of future readers, I don't think the error message quoted above has anything to do with that.

> [@lochr](#):
>
> according to the [documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-settings.html) 127.0.0.1 should be the default

It is, roughly, but the default behaviour is [subtly different](https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-discovery-bootstrap-cluster.html#_auto_bootstrapping_in_development_mode) from the behaviour when you set it explicitly.

---

<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:** [January 27, 2021, 8:37pm UTC](https://discuss.elastic.co/t/issue-with-too-little-memory-running-several-docker-container-including-elasticsearch/259913/6 "2021-01-27T20:37:30Z")

</div>

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