# Master not discovered or elected yet in docker envirement

**URL:** <https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-in-docker-envirement/196476>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [August 23, 2019, 9:17am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-in-docker-envirement/196476 "2019-08-23T09:17:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AhmedAkkarii](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@AhmedAkkarii](https://discuss.elastic.co/u/AhmedAkkarii)\
**Post date:** [August 23, 2019, 9:17am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-in-docker-envirement/196476/1 "2019-08-23T09:17:42Z")

</div>

Hello,

I'm in a strange problem as my Elasticsearch has produced this error:

`{"type": "server", "timestamp": "2019-08-23T09:16:03,122+0000", "level": "WARN", "component": "o.e.c.c.ClusterFormationFailureHelper", "cluster.name": "docker-cluster", "node.name": "b3d98339aefc", "message": "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [opencti-dev-elasticsearch-01] to bootstrap a cluster: have discovered []; discovery will continue using [127.0.0.1:9300, 127.0.0.1:9301, 127.0.0.1:9302, 127.0.0.1:9303, 127.0.0.1:9304, 127.0.0.1:9305] from hosts providers and [{b3d98339aefc}{bH9-FdhtRkyzPEG8577SvQ}{CZV4x7TIS62xYjgpkCMmDA}{172.18.0.3}{172.18.0.3:9300}{ml.machine_memory=3086381056, xpack.installed=true, ml.max_open_jobs=20}] from last-known cluster state; node term 0, last-accepted version 0 in term 0" }`

my docker compose file is :

```
version: '3'
  opencti-dev-elasticsearch-01:
    container_name: opencti-dev-elasticsearch
    image: docker.elastic.co/elasticsearch/elasticsearch:7.2.0
    container_name: opencti-dev-elasticsearch-01
    environment:
      - cluster.initial_master_nodes=opencti-dev-elasticsearch-01
    restart: always
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
    ports:
      - 9200:9200 

```

Is there any changes I can make in docker compose file to solve the issue ?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [August 23, 2019, 9:56am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-in-docker-envirement/196476/2 "2019-08-23T09:56:16Z")

</div>

Here is the one I'm using:

```auto
---
version: '3'
services:

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.3.1
    environment:
      - bootstrap.memory_lock=true
      - discovery.type=single-node
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - 9200:9200

```

HTH

---

<div class="post-metadata">

**Author:** ![AhmedAkkarii](https://avatars.discourse-cdn.com/v4/letter/a/a6a055/32.png) [@AhmedAkkarii](https://discuss.elastic.co/u/AhmedAkkarii)\
**Post date:** [August 23, 2019, 10:40am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-in-docker-envirement/196476/3 "2019-08-23T10:40:14Z")

</div>

Thank you, problem solved!.

---

<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:** [September 20, 2019, 10:40am UTC](https://discuss.elastic.co/t/master-not-discovered-or-elected-yet-in-docker-envirement/196476/4 "2019-09-20T10:40:23Z")

</div>

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