2

I use the following docker-compose to run an elasticsearch cluster and kibana:

services:
  odfe-node1:
    image: amazon/opendistro-for-elasticsearch:1.3.0
    container_name: odfe-node1
    environment:
      - cluster.name=odfe-cluster
      - node.name=odfe-node1
      - discovery.seed_hosts=odfe-node1,odfe-node2
      - cluster.initial_master_nodes=odfe-node1,odfe-node2
      - bootstrap.memory_lock=true # along with the memlock settings below, disables swapping
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m" # minimum and maximum Java heap size, recommend setting both to 50% of system RAM
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536 # maximum number of open files for the Elasticsearch user, set to at least 65536 on modern systems
        hard: 65536
    volumes:
      - odfe-data1:/usr/share/elasticsearch/data
    ports:
      - 9200:9200
      - 9600:9600 # required for Performance Analyzer
    networks:
      - odfe-net
  odfe-node2:
    image: amazon/opendistro-for-elasticsearch:1.3.0
    container_name: odfe-node2
    environment:
      - cluster.name=odfe-cluster
      - node.name=odfe-node2
      - discovery.seed_hosts=odfe-node1,odfe-node2
      - cluster.initial_master_nodes=odfe-node1,odfe-node2
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
    volumes:
      - odfe-data2:/usr/share/elasticsearch/data
    networks:
      - odfe-net
  kibana:
    image: amazon/opendistro-for-elasticsearch-kibana:1.3.0
    container_name: odfe-kibana
    ports:
      - 5601:5601
    expose:
      - "5601"
    environment:
      ELASTICSEARCH_URL: https://odfe-node1:9200
      ELASTICSEARCH_HOSTS: https://odfe-node1:9200
      LOGGING_VERBOSE: "true"
    networks:
      - odfe-net

volumes:
  odfe-data1:
  odfe-data2:

networks:
  odfe-net:

No errors show up in logs, and elastic cluster runs fine - I can query and submit documents; but when I try to load Kibana by going to http://localhost:5601 in the browser, I get Kibana server is not ready yet message both in the browser and in the logs.

Any ideas about what might be wrong?

Andrey
  • 20,487
  • 26
  • 108
  • 176
  • How long did you wait? – IanGabes Jan 09 '20 at 21:08
  • @IanGabes It's been running for 50 min and still gives the same message – Andrey Jan 09 '20 at 21:13
  • I asked because I have definitely seen Kibana take up to 10 or 15 minutes to "optimize" itself on first boot, but 50 minutes is much to long(probably). I ran into similar issues with the mainline kibana talked about here: https://discuss.elastic.co/t/kibana-not-starting-stuck-at-optimizing-and-caching-bundles-after-upgrade/157870 – IanGabes Jan 09 '20 at 21:34
  • 1
    @IanGabes Turns out Docker didn't have enough memory allocated to it. I gave it 4GB RAM and things started working – Andrey Jan 10 '20 at 23:24
  • Glad you figured it out! – IanGabes Jan 11 '20 at 14:40

2 Answers2

3

Turned out that I had to allocate more memory for the Docker service (Settings -> Advanced) and Kibana starts as expected now

Andrey
  • 20,487
  • 26
  • 108
  • 176
0

The issue was kibana was unable to access elasticsearch locally. I think that you have enabled xpack.security plugin at elasticsearch.yml by adding a new line :

xpack.security.enabled : true

If so you need to uncomment the two lines on kibana.yml : #elasticsearch.username & #elasticsearch.password and set

elasticsearch.username = kibana elasticsearch.password = your-password

after that save the changes and restart kibana service : sudo systemctl restart kibana.service

nick
  • 346
  • 2
  • 4