0
votes

I am trying to run ELK stack on Docker using docker-compose. I am not seeing any errors But I am only able to access elasticsearch but not Kibana. No page is being loaded when I try to access localhost:5601. Here is the docker-compose file

version: '2.2'
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:6.4.0
    container_name: elasticsearch
    environment:
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - esdata1:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
    networks:
      - esnet
  elasticsearch2:
    image: docker.elastic.co/elasticsearch/elasticsearch:6.4.0
    container_name: elasticsearch2
    environment:
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - "discovery.zen.ping.unicast.hosts=elasticsearch"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - esdata2:/usr/share/elasticsearch/data
    networks:
      - esnet
  kibana:
    image: docker.elastic.co/kibana/kibana:6.4.0
    ports:
      - 5601:5601
    environment:
      ELASTICSEARCH_URL: http://elasticsearch:9200
    networks:
        - esnet
volumes:
  esdata1:
    driver: local
  esdata2:
    driver: local

networks:
  esnet:
    driver: bridge
2
I think you need to add an expose: -port for elasticsearch and kibanaNate
@Nate when you declare the port as "out:in" you are doing a implicit expose, but about the actual question, you tried to remove the user defined network and the user defined volumes first?, just for testing if the thing runs? (so we can be sure that is not a docker issue).Sebastián Espinosa

2 Answers

0
votes

As I see, you have used a user-defined network named esnet, in this way you have to publish the required ports. See this question, it might help you.

0
votes

I was able to get it working with single node of Elastic search. Here is the docker-compose file that is working

version: '2.2'
services:
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:6.8.0
    container_name: elasticsearch
    environment:
      - cluster.name=docker-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - esdata1:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
      - 9300:9300
    networks:
      - esnet
  kibana:
    image: docker.elastic.co/kibana/kibana:6.8.0
    container_name: kib01
    ports:
      - 5601:5601
    environment:
      SERVER_NAME: kibana
      SERVER_HOST: kibana
      ELASTICSEARCH_URL: http://elasticsearch:9200
      XPACK_MONITORING_ENABLED: "true"
    networks:
      - esnet

volumes:
  esdata1:
    driver: local
  esdata2:
    driver: local

networks:
  esnet:
    driver: bridge