1
votes

I'm running into a weird situation : today morning I configured a docker-compose.yml file on ubuntu 16.04 everything was ok, later on I tried the same docker configuration on a different PC with ubuntu 16.04 it didn't work.

The elasticsearch image appears and disappears, ports 9200 and 5601 are not occupied

docker-compose.yml :

version: '3'
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:7.6.2
    environment:
      - discovery.type=single-node
    ports:
      - 9200:9200
  kibana:
    image: docker.elastic.co/kibana/kibana:7.6.2
    ports:
      - 5601:5601

enter image description here

I tried to change the ports and add ELASTICSEARCH_URL: http://elasticsearch:9200/ nothing worked!!!

[root@localhost ELK]# curl localhost:5601
Kibana server is not ready yet[root@localhost ELK]#
1

1 Answers

1
votes

Check the logs first. Only run the elasticsearch container without the -d option in docker-compose and see the logs.

Its most likely an issue with certain other parameters you'll need.

First do

sysctl -w vm.max_map_count=262144

Also add vm.max_map_count setting to /etc/sysctl.conf to make it permanent.

Add ulimits and other few parameters to docker-compose

ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536

environment:
    - "ES_JAVA_OPTS=-Xms1g -Xmx1g"

Check How to use the official docker elasticsearch container? and docker-compose.yml for elasticsearch 7.0.1 and kibana 7.0.1 for more