No living connections - Cannot start kibana

I'm trying to run a docker-compose with kibana and elasticsearch. I tried with 4 different options that i found on the internet, but i keep having the same problem: Kibana server is not ready yet on localhost:5601.
Thse are the logs of kibana:

{"type":"log","@timestamp":"2019-06-25T13:56:10Z","tags":["warning","elasticsearch","admin"],"pid":1,"message":"Unable to revive connection: http://localhost:9200/"}
    {"type":"log","@timestamp":"2019-06-25T13:56:10Z","tags":["warning","elasticsearch","admin"],"pid":1,"message":"No living connections"}
    {"type":"log","@timestamp":"2019-06-25T13:56:10Z","tags":["warning","task_manager"],"pid":1,"message":"PollError No Living connections"}

And thse the logs of elasticsearch:

{"type": "server", "timestamp": "2019-06-25T13:55:45,026+0000", "level": "INFO", "component": "o.e.x.w.WatcherService", "cluster.name": "docker-cluster", "node.name": "4e25d8fad2bd", "cluster.uuid": "H6iO-YSZTguM1Lb8H2OCyA", "node.id": "c2RFywSVQeyDC373bYDkhw",  "message": "reloading watcher, reason [new local watcher shard allocation ids], cancelled [0] queued tasks"  }
{"type": "server", "timestamp": "2019-06-25T13:55:45,505+0000", "level": "INFO", "component": "o.e.c.r.a.AllocationService", "cluster.name": "docker-cluster", "node.name": "4e25d8fad2bd", "cluster.uuid": "H6iO-YSZTguM1Lb8H2OCyA", "node.id": "c2RFywSVQeyDC373bYDkhw",  "message": "Cluster health status changed from [RED] to [GREEN] (reason: [shards started [[.monitoring-es-7-2019.06.24][0], [.watcher-history-9-2019.06.24][0]] ...])."  }
{"type": "server", "timestamp": "2019-06-25T13:56:47,341+0000", "level": "INFO", "component": "o.e.c.m.MetaDataMappingService", "cluster.name": "docker-cluster", "node.name": "4e25d8fad2bd", "cluster.uuid": "H6iO-YSZTguM1Lb8H2OCyA", "node.id": "c2RFywSVQeyDC373bYDkhw",  "message": "[.watcher-history-9-2019.06.25/WNhdDDG_TY6xVrI1x31gOA] update_mapping [_doc]"  }

Here's the docker-compose.yml file:

version: '3'

services:

  elasticsearch:
    build:
      context: elasticsearch/
      args:
        ELK_VERSION: $ELK_VERSION
    volumes:
      - ./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
    ports:
      - "9200:9200"
      - "9300:9300"
    environment:
      - "ES_JAVA_OPTS: -Xmx6g -Xms6g"
      - "ELASTIC_PASSWORD:Elko14."
    networks:
      - elk
  kibana:
    build:
      context: kibana/
      args:
        ELK_VERSION: $ELK_VERSION
    volumes:
      - ./kibana/config/kibana.yml:/usr/share/kibana/config/kibana.yml:ro
    ports:
      - "5601:5601"
    environment:
      - "ELASTICSEARCH_URL: http://elasticsearch:9300"
    networks:
      - elk
    depends_on:
      - elasticsearch

networks:

  elk:
          driver: bridge

kibana.yml:

server.name: kibana
server.host: "0.0.0.0"
server.host: "0"
server.cors: true
server.cors.origin: ['*']
elasticsearch.hosts: ["http://localhost:9200"]
xpack.monitoring.ui.container.elasticsearch.enabled: true

## X-Pack security credentials
#
elasticsearch.username: "elastic"
elasticsearch.password: "something"

kibana's Dockerfile:

ARG ELK_VERSION

# https://github.com/elastic/kibana-docker
FROM docker.elastic.co/kibana/kibana:${ELK_VERSION}

elasticsearch.yml:

cluster.name: "docker-cluster"
network.host: 0.0.0.0

## Use single node discovery in order to disable production mode and avoid bootstrap checks
## see https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html
#
discovery.type: single-node

## X-Pack settings
## see https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-xpack.html
#
xpack.license.self_generated.type: trial
xpack.security.enabled: true
xpack.monitoring.collection.enabled: true

elasticsearch's Dockerfile:

ARG ELK_VERSION

# https://github.com/elastic/elasticsearch-docker
FROM docker.elastic.co/elasticsearch/elasticsearch:${ELK_VERSION}

Please format your code, logs or configuration files using </> icon as explained in this guide and not the citation button. It will make your post more readable.

Or use markdown style like:

```
CODE
```

This is the icon to use if you are not using markdown format:

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.
Please update your post.

Have a look at Unable to set password for elastic (7.1.1) where I shared the one I'm using.

Sorry, i already updated it

Did you read:

Have a look at Unable to set password for elastic (7.1.1) where I shared the one I'm using.

?

It worked, thanks

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