# Newbie: CentOS + Docker + Elastic Stack = Master not discovered yet

**URL:** <https://discuss.elastic.co/t/newbie-centos-docker-elastic-stack-master-not-discovered-yet/255240>\
**Category:** Elasticsearch\
**Created:** [November 12, 2020, 4:26pm UTC](https://discuss.elastic.co/t/newbie-centos-docker-elastic-stack-master-not-discovered-yet/255240 "2020-11-12T16:26:22Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elitlogik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elitlogik/32/78920_2.png) [@Elitlogik](https://discuss.elastic.co/u/Elitlogik)\
**Post date:** [November 12, 2020, 4:26pm UTC](https://discuss.elastic.co/t/newbie-centos-docker-elastic-stack-master-not-discovered-yet/255240/1 "2020-11-12T16:26:23Z")

</div>

I'm trying to start learning Elastic Stack, but I can't get it to even start.

I have:

- Installed CentOS 8 Minimal
- Installed Docker, following this: [https://docs.docker.com/engine/install/centos/](https://docs.docker.com/engine/install/centos/)
- Managing non-root and startup on boot: [https://docs.docker.com/engine/install/linux-postinstall/](https://docs.docker.com/engine/install/linux-postinstall/)
- Installed Docker Compose: [https://docs.docker.com/compose/install/](https://docs.docker.com/compose/install/)
- Installed Elastic Stack with Docker Compose: [https://www.elastic.co/guide/en/elastic-stack-get-started/current/get-started-docker.html](https://www.elastic.co/guide/en/elastic-stack-get-started/current/get-started-docker.html)

Nothing else...

curl -X GET "localhost:9200/\_cat/nodes?v&pretty" times out and logs are showing

es02 | {"type": "server", "timestamp": "2020-11-12T16:24:53,337Z", "level": "WARN", "component": "o.e.c.c.ClusterFormationFailureHelper", "cluster.name": "es-docker-cluster", "node.name": "es02", "message": "master not discovered yet, this node has not previously joined a bootstrapped (v7+) cluster, and this node must discover master-eligible nodes [es01, es02, es03] to bootstrap a cluster: have discovered [{es02}{t\_NDy9i1RlqsgLreV0nvFg}{qX-KZ7raTjKWnSbCkcxCaw}{172.18.0.2}{172.18.0.2:9300}{cdhilmrstw}{ml.machine\_memory=8073846784, xpack.installed=true, transform.node=true, ml.max\_open\_jobs=20}]; discovery will continue using [172.18.0.3:9300, 172.18.0.4:9300] from hosts providers and [{es02}{t\_NDy9i1RlqsgLreV0nvFg}{qX-KZ7raTjKWnSbCkcxCaw}{172.18.0.2}{172.18.0.2:9300}{cdhilmrstw}{ml.machine\_memory=8073846784, xpack.installed=true, transform.node=true, ml.max\_open\_jobs=20}] from last-known cluster state; node term 0, last-accepted version 0 in term 0" }

I would love to see this running...

What can possible be wrong?

Thank you very much for your support!

---

<div class="post-metadata">

**Author:** ![Elitlogik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elitlogik/32/78920_2.png) [@Elitlogik](https://discuss.elastic.co/u/Elitlogik)\
**Post date:** [November 12, 2020, 9:46pm UTC](https://discuss.elastic.co/t/newbie-centos-docker-elastic-stack-master-not-discovered-yet/255240/2 "2020-11-12T21:46:30Z")

</div>

Should I try 7.9.3 to see if it works better? Or is this an issue within CentOS firewalling or Docker?

Actually I don’t know where to start looking...

---

<div class="post-metadata">

**Author:** ![Elitlogik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elitlogik/32/78920_2.png) [@Elitlogik](https://discuss.elastic.co/u/Elitlogik)\
**Post date:** [November 13, 2020, 6:09am UTC](https://discuss.elastic.co/t/newbie-centos-docker-elastic-stack-master-not-discovered-yet/255240/3 "2020-11-13T06:09:15Z")

</div>

I’ll give Elastic another chance by installing CentOS 7, Docker, Docker Compose and “Run Elastic Stack on Docker” to see if it’s working.

---

<div class="post-metadata">

**Author:** ![Elitlogik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elitlogik/32/78920_2.png) [@Elitlogik](https://discuss.elastic.co/u/Elitlogik)\
**Post date:** [November 13, 2020, 8:23am UTC](https://discuss.elastic.co/t/newbie-centos-docker-elastic-stack-master-not-discovered-yet/255240/4 "2020-11-13T08:23:38Z")

</div>

Nope, that didn't do it. Same result.

I can't imagine why a first install according to suggested methods fails.

---

<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:** [November 13, 2020, 8:35am UTC](https://discuss.elastic.co/t/newbie-centos-docker-elastic-stack-master-not-discovered-yet/255240/5 "2020-11-13T08:35:39Z")

</div>

Here is how I'm setting that with docker compose ( `docker-compose.yml`):

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

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:$ELASTIC_VERSION
    environment:
      - bootstrap.memory_lock=true
      - discovery.type=single-node
      - ELASTIC_PASSWORD=$ELASTIC_PASSWORD
      - xpack.security.enabled=$ELASTIC_SECURITY
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - 9200:9200
    networks: ['stack']

  kibana:
    image: docker.elastic.co/kibana/kibana:$ELASTIC_VERSION
    environment:
      - ELASTICSEARCH_USERNAME=elastic
      - ELASTICSEARCH_PASSWORD=$ELASTIC_PASSWORD
    ports: ['5601:5601']
    networks: ['stack']
    links: ['elasticsearch']
    depends_on: ['elasticsearch']

networks:
  stack: {}

```

`.env` file is:

```auto
ELASTIC_VERSION=7.10.0
ELASTIC_SECURITY=true
ELASTIC_PASSWORD=changeme

```

---

<div class="post-metadata">

**Author:** ![Elitlogik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elitlogik/32/78920_2.png) [@Elitlogik](https://discuss.elastic.co/u/Elitlogik)\
**Post date:** [November 13, 2020, 8:43am UTC](https://discuss.elastic.co/t/newbie-centos-docker-elastic-stack-master-not-discovered-yet/255240/6 "2020-11-13T08:43:59Z")

</div>

Thank you, will try.

How do you refer the .env file?

---

<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:** [November 13, 2020, 8:55am UTC](https://discuss.elastic.co/t/newbie-centos-docker-elastic-stack-master-not-discovered-yet/255240/7 "2020-11-13T08:55:02Z")

</div>

You don't. It's read by default by docker-compose.

---

<div class="post-metadata">

**Author:** ![Elitlogik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elitlogik/32/78920_2.png) [@Elitlogik](https://discuss.elastic.co/u/Elitlogik)\
**Post date:** [November 13, 2020, 8:56am UTC](https://discuss.elastic.co/t/newbie-centos-docker-elastic-stack-master-not-discovered-yet/255240/8 "2020-11-13T08:56:09Z")

</div>

> [@dadoonet](#):
>
> ```auto
> ELASTIC_VERSION=7.10.0
> ELASTIC_SECURITY=true
> ELASTIC_PASSWORD=changeme
> 
> ```

Thank you very much for your reply and support!

I get a lot of connection errors. How can I troubleshoot the networking issues? Are they within Docker or CentOS?

`{"type":"log","@timestamp":"2020-11-13T08:52:56Z","tags":["warning","elasticsearch","monitoring"],"pid":6,"message":"Unable to revive connection: http://elasticsearch:9200/"}`

`{"type":"log","@timestamp":"2020-11-13T08:52:56Z","tags":["warning","elasticsearch","monitoring"],"pid":6,"message":"No living connections"}`

`{"type":"log","@timestamp":"2020-11-13T08:52:56Z","tags":["warning","plugins","licensing"],"pid":6,"message":"License information could not be obtained from Elasticsearch due to Error: No Living connections error"}`

`{"type":"log","@timestamp":"2020-11-13T08:52:59Z","tags":["error","elasticsearch","data"],"pid":6,"message":"[ConnectionError]: connect EHOSTUNREACH 172.19.0.2:9200"}`

---

<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:** [November 13, 2020, 11:27am UTC](https://discuss.elastic.co/t/newbie-centos-docker-elastic-stack-master-not-discovered-yet/255240/9 "2020-11-13T11:27:23Z")

</div>

Did you just used the config I shared or modified it?

---

<div class="post-metadata">

**Author:** ![Elitlogik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elitlogik/32/78920_2.png) [@Elitlogik](https://discuss.elastic.co/u/Elitlogik)\
**Post date:** [November 13, 2020, 1:43pm UTC](https://discuss.elastic.co/t/newbie-centos-docker-elastic-stack-master-not-discovered-yet/255240/10 "2020-11-13T13:43:52Z")

</div>

Exactly your config. Containers are up and running, and I can authenticate. But they don't see each other. Or... A ping from one container to the other works. But not a curl, and the errors are also as above.

curl elasticsearch -\> No route to host  
curl [http://elasticsearch:9200/](http://elasticsearch:9200/) -\> No route to host  
curl elasticdoesntwork -\> Unknown error  
curl [http://elasticdoesntwork:9200/](http://elasticdoesntwork:9200/) -\> Unknown error

---

<div class="post-metadata">

**Author:** ![abrx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abrx/32/43881_2.png) [@abrx](https://discuss.elastic.co/u/abrx)\
**Post date:** [November 13, 2020, 2:00pm UTC](https://discuss.elastic.co/t/newbie-centos-docker-elastic-stack-master-not-discovered-yet/255240/11 "2020-11-13T14:00:54Z")

</div>

What does a `nslookup elasticsearch` or `nslookup elasticdoesntwork` returns from your containers ? What if you are using ip adress instead of it ?

---

<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:** [November 13, 2020, 3:08pm UTC](https://discuss.elastic.co/t/newbie-centos-docker-elastic-stack-master-not-discovered-yet/255240/12 "2020-11-13T15:08:55Z")

</div>

Sorry but what do you mean by containers can't see each others? In my example, there's only one elasticsearch node. If you have multiple nodes, it means that you did something else than just running `docker-compose up` right?

---

<div class="post-metadata">

**Author:** ![Elitlogik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elitlogik/32/78920_2.png) [@Elitlogik](https://discuss.elastic.co/u/Elitlogik)\
**Post date:** [November 13, 2020, 3:46pm UTC](https://discuss.elastic.co/t/newbie-centos-docker-elastic-stack-master-not-discovered-yet/255240/13 "2020-11-13T15:46:15Z")

</div>

> [@dadoonet](#):
>
> Sorry but what do you mean by containers can't see each others

You have an elasticsearch container and a kibana container, and the kibana container will have to connect to the elasticsearch container on port 9200.

In my environment, Kibana fails to do so.

---

<div class="post-metadata">

**Author:** ![Elitlogik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elitlogik/32/78920_2.png) [@Elitlogik](https://discuss.elastic.co/u/Elitlogik)\
**Post date:** [November 13, 2020, 3:55pm UTC](https://discuss.elastic.co/t/newbie-centos-docker-elastic-stack-master-not-discovered-yet/255240/14 "2020-11-13T15:55:53Z")

</div>

> [@abrx](#):
>
> What does a `nslookup elasticsearch` or `nslookup elasticdoesntwork` returns from your containers ?

Are you on to something? nslookup is a command not found neither from the kibana container not the host CentOS 8 Minimal.

---

<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:** [November 13, 2020, 5:51pm UTC](https://discuss.elastic.co/t/newbie-centos-docker-elastic-stack-master-not-discovered-yet/255240/15 "2020-11-13T17:51:53Z")

</div>

How did you launch the containers?

---

<div class="post-metadata">

**Author:** ![Elitlogik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elitlogik/32/78920_2.png) [@Elitlogik](https://discuss.elastic.co/u/Elitlogik)\
**Post date:** [November 13, 2020, 6:25pm UTC](https://discuss.elastic.co/t/newbie-centos-docker-elastic-stack-master-not-discovered-yet/255240/16 "2020-11-13T18:25:07Z")

</div>

I have tried:

docker-compose up  
docker-compose up -d  
Starting from Portainer  
docker run (from these examples [https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html))

I have tried doing every scenario as root and non-root.

And... It has always been the cannot find host [http://elasticsearch:9200/](http://elasticsearch:9200/) error. Kibana cannot find it and neither other ES nodes when making a cluster. That, together with curl returning “No route” has always been the problem with CentOS. I didn’t have the problem when running Docker on Ubuntu Server 20.04.

Any ideas?

---

<div class="post-metadata">

**Author:** ![Elitlogik](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elitlogik/32/78920_2.png) [@Elitlogik](https://discuss.elastic.co/u/Elitlogik)\
**Post date:** [November 14, 2020, 6:10pm UTC](https://discuss.elastic.co/t/newbie-centos-docker-elastic-stack-master-not-discovered-yet/255240/17 "2020-11-14T18:10:18Z")

</div>

Ok, firewalld process wasn’t automated by Docker, like this article says:

[https://medium.com/@Azhagarasu/docker-and-firewalld-mess-in-centos-7-934cb7c7fb48](https://medium.com/@Azhagarasu/docker-and-firewalld-mess-in-centos-7-934cb7c7fb48)

So, you manually have to set trust to new containers and networks.

Case closed

---

<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 12, 2020, 6:10pm UTC](https://discuss.elastic.co/t/newbie-centos-docker-elastic-stack-master-not-discovered-yet/255240/18 "2020-12-12T18:10:27Z")

</div>

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