Docker Kibana: Cannot connect to the Elasticsearch cluster currently configured for Kibana

I'm using the Docker image for Kibana 7.2.0. I'm trying to connect it to an Elasticsearch Docker container as part of the following docker-compose file:

version: "3"
services:
  fess:
    image: codelibs/fess:13.2
    restart: always
    ports:
      - "8080:8080"
    depends_on:
      - elasticsearch
    environment:
      - RUN_ELASTICSEARCH=false
      - "ES_HTTP_URL=http://elasticsearch:9200"
    volumes:
      - /srv/data/fess/config:/opt/fess
    networks:
      - esnet

  elasticsearch:
    image: codelibs/fess:13.2
    restart: always
    environment:
      - RUN_FESS=false
      - "ES_JAVA_OPTS=\"-Xms2g -Xmx2g\""
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - /srv/data/es/data:/var/lib/elasticsearch
    networks:
      - esnet

  kibana:
    image: docker.elastic.co/kibana/kibana:7.2.0
    restart: always
    ports:
      - "5601:5601"
    depends_on:
      - elasticsearch
    networks:
      - esnet

volumes:
  esdata:
    driver: local

networks:
  esnet:
    driver: bridge

The fess Docker image provides Elasticsearch 7.2.0 and this is confirmed if I enter the Kibana running container and curl the ES server:

bash-4.2$ curl http://elasticsearch:9200
{
  "name" : "9d15b486fb67",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "uJmUqL4ZR7-l2X7zG92Cbw",
  "version" : {
    "number" : "7.2.0",
    "build_flavor" : "oss",
    "build_type" : "deb",
    "build_hash" : "508c38a",
    "build_date" : "2019-06-20T15:54:18.811730Z",
    "build_snapshot" : false,
    "lucene_version" : "8.0.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

However, when I try to browse to the Kibana server on port 5601, I get this message:

image

The kibana.yml file is:

#
# ** THIS IS AN AUTO-GENERATED FILE **
#

# Default Kibana configuration for docker target
server.name: kibana
server.host: "0"
elasticsearch.hosts: [ "http://elasticsearch:9200" ]
xpack.monitoring.ui.container.elasticsearch.enabled: true

Any suggestions as to what I need to do in order to get Kibana successfully connecting to ES?

Thanks.

As far as I remember you also need to connect(or link for the legacy term) both docker containers to the same network for it to work.

Thank you. The author of the docker-compose file I was using has updated it to get Kibana working correctly with ES.

1 Like

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