2
votes

I am trying to setup a new version of Kibana and Elasticsearch on my server. I have an existing K and E running with default ports (5601, 9200) and upgrading the existing data is not an option. I'd like to run newer versions (7.4.2) of K and E in Docker, using different ports (5611:5601, 9211:9200) to access the containers. I have new data area available.

I believe I have Elasticsearch running correctly, but Kibana's overrides for finding Elasticsearch are not working for me. I've attached my docker-compose.yml file.

Thank you in advance for your help.

version: '3'

networks:
  elk01:
    driver: bridge

services:
  es01:
    image: elasticsearch:7.4.2
    container_name: es01
    user: "983"
    networks:
      - elk01
    environment:
      #- cluster.initial_master_nodes=es01
      - cluster.name=docker-cluster
      - discovery.type=single-node
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms4g -Xmx4g -XX:-HeapDumpOnOutOfMemoryError"
      #- ES_JAVA_OPTS: "-Xms4g -Xmx4g -XX:-HeapDumpOnOutOfMemoryError"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - "9211:9200"
      - "9311:9300"
    expose:
      - "9211"
    volumes:
      - /elk/elk7_4_2/elasticsearch/data:/usr/share/elasticsearch/data
      - /elk/elk7_4_2/elasticsearch/logs:/usr/share/elasticsearch/logs

  k01:
    depends_on:
    - es01
    image: kibana:7.4.2
    container_name: k01
    user: "981"
    networks:
      - elk01
    environment:
      - SERVER_NAME=kibana.localhost
      - ELASTICSEARCH_URL=http://es01:9211
      - ELASTICSEARCH_HOST=es01
      - ELASTICSEARCH_PORT=9211
      #- ELASTICSEARCH_USERNAME=elastic
      #- ELASTIC_PWD=changeme
      #- KIBANA_PWD=changeme
      - xpack.security.enabled=false
    ports:
      - "5611:5601"
    expose:
      - "5611"

Kibana errors

k01     | {"type":"log","@timestamp":"2019-11-22T22:08:58Z","tags":["reporting","browser-driver","warning"],"pid":8,"message":"Enabling the Chromium sandbox provides an additional layer of protection."}
k01     | {"type":"log","@timestamp":"2019-11-22T22:08:59Z","tags":["error","elasticsearch","admin"],"pid":8,"message":"Request error, retrying\nHEAD http://elasticsearch:9200/.apm-agent-configuration => getaddrinfo ENOTFOUND elasticsearch elasticsearch:9200"}
k01     | {"type":"log","@timestamp":"2019-11-22T22:08:59Z","tags":["error","elasticsearch","admin"],"pid":8,"message":"Request error, retrying\nGET http://elasticsearch:9200/_nodes?filter_path=nodes.*.version%2Cnodes.*.http.publish_address%2Cnodes.*.ip => getaddrinfo ENOTFOUND elasticsearch elasticsearch:9200"}
k01     | {"type":"log","@timestamp":"2019-11-22T22:08:59Z","tags":["warning","elasticsearch","admin"],"pid":8,"message":"Unable to revive connection: http://elasticsearch:9200/"}
k01     | {"type":"log","@timestamp":"2019-11-22T22:08:59Z","tags":["warning","elasticsearch","admin"],"pid":8,"message":"No living connections"}
k01     | {"type":"log","@timestamp":"2019-11-22T22:08:59Z","tags":["status","plugin:[email protected]","error"],"pid":8,"state":"red","message":"Status changed from yellow to red - No Living connections","prevState":"yellow","prevMsg":"Waiting for Elasticsearch"}
k01     | {"type":"log","@timestamp":"2019-11-22T22:08:59Z","tags":["status","plugin:[email protected]","error"],"pid":8,"state":"red","message":"Status changed from yellow to red - No Living connections","prevState":"yellow","prevMsg":"Waiting for Elasticsearch"}
2

2 Answers

2
votes

You should expose port 9200 from elasticsearch container, as 9200 dockers port is being used by es. also kibana is running in another container which can see only exposed ports from another container which should be 9200 in this case.

for more details check- What is the difference between docker-compose ports vs expose

2
votes

ELASTICSEARCH_URL has been replaced by ELASTICSEARCH_HOSTS :

ELASTICSEARCH_HOSTS: http://es01:9200

https://www.elastic.co/guide/en/kibana/current/docker.html