Docker Compose for Elastic+Kibana? Errors when starting

HI All,

I tried to bring up elastic and kibana using docker, but it seems to have gone wrong. Does anyone have any suggestions for me?

I took this docker compose file as my starting point:
https://github.com/elastic/stack-docker/blob/master/docker-compose.yml

I removed most things, except for the desired elastic + kibana entries, and I added "discovery.type=single-node" like this:

elasticsearch:
    container_name: elasticsearch
    image: docker.elastic.co/elasticsearch/elasticsearch-oss:${TAG}
    #command: -e "discovery.type=single-node"
    environment:
    - discovery.type=single-node
    ...

I started everything up via:

ELASTIC_VERSION=6.1.3 TAG=6.1.3 ELASTIC_PASSWORD=changeme docker-compose up

However there are quite a few errors on stdout/stderr e.g.

    "License information from the X-Pack plugin could not be obtained from
    Elasticsearch for the [data] cluster. [invalid_index_name_exception]
    Invalid index name [_xpack], must not start with '_'.

I am able to access the Kibana URL (http://localhost:5601/) but on the initial login screen is a warning:

Login is currently disabled. Administrators should consult the Kibana logs for more details.

Any ideas about the source of the problem?
I assume I'm meant to supply the password via the environment (and that "changeme" is correct)?
I chose the "basic" OSS ES image version, perhaps should I have pulled the Xpack image instead?

These are the docker images I used:

REPOSITORY                                          TAG                 IMAGE ID            CREATED             SIZE
docker.elastic.co/kibana/kibana                     6.1.3               a3f439b54fc4        7 days ago          963MB
docker.elastic.co/elasticsearch/elasticsearch-oss   6.1.3               eea176d246d7        7 days ago          475MB
archlinux/base                                      latest              71415bf73a2b        5 weeks ago         394MB

Oh, I just noticed that much further down in the original github docker-compose file there is another Kibana related entry called "setup_kibana" ... maybe I also need to include/run that in my compose file?

Thanks in advance!

Here is a docker-compose file I'm using:

---
version: '3'
services:

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch-platinum:$ELASTIC_VERSION
    environment:
      - bootstrap.memory_lock=true
      - ELASTIC_PASSWORD=changeme
      - discovery.type=single-node
      - "ES_JAVA_OPTS=-Xms2g -Xmx2g"
      - cluster.routing.allocation.disk.threshold_enabled=false
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - 9200:9200
    networks: ['stack']

  kibana:
    image: docker.elastic.co/kibana/kibana:$ELASTIC_VERSION
    links:
      - elasticsearch
    ports:
      - 5601:5601
    networks: ['stack']
    depends_on:
      - elasticsearch

networks:
  stack: {}
$ cat .env 
ELASTIC_VERSION=6.1.3

I'm also using this one for another purpose:

---
version: '3'
services:

  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch:$ELASTIC_VERSION
    environment:
      - bootstrap.memory_lock=true
      - discovery.type=single-node
      - "ES_JAVA_OPTS=-Xms2g -Xmx2g"
      - cluster.routing.allocation.disk.threshold_enabled=false
      - xpack.security.enabled=false
      - xpack.ml.enabled=false
      - xpack.watcher.enabled=false
    ulimits:
      memlock:
        soft: -1
        hard: -1
    ports:
      - 9200:9200
    networks: ['stack']

  kibana:
    image: docker.elastic.co/kibana/kibana:$ELASTIC_VERSION
    links:
      - elasticsearch
    ports:
      - 5601:5601
    networks: ['stack']
    depends_on:
      - elasticsearch

networks:
  stack: {}

I hope this can help.

Humm. Well those are two different compose file examples. Different from that in github and from each other.

The xpack.*.enabled=false options looked promising - it seemed like they might be related to one of my problems (e.g the "Invalid index name [_xpack]" error). However when I added them to my compose file elasticsearch crashes at start time with an IllegalArgumentException i.e.

elasticsearch    | [2018-02-05T21:13:26,112][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
elasticsearch    | org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: unknown setting [xpack.watcher.enabled] please check that any required plugins are installed, or check the breaking changes documentation for removed settings

You must be using a different version of elasticsearch.

Oh well.

Sure.
You are using docker.elastic.co/elasticsearch/elasticsearch-oss which does not come with x-pack.

That was one of the questions in my original post! I.e.

Is the oss version functional? I can certainly try the x-pack version if you think it would help. Although, from what I have read on your site, it seems that it should be the case that kibana + es-oss should work.

Which brings us back to my other questions:

  1. Kibana Web UI error: Login is currently disabled. Why? How to further analyse?
  2. Stream of errors of the form: License information from the X-Pack plugin could not be obtained ... invalid_index_name_exception. Does this indicate a problem?
  3. I assume I'm meant to supply the password via the environment (and that "changeme" is correct)?
  4. Much further down in your (elastic.co) github docker-compose file there is another Kibana related entry called "setup_kibana". Is this required?

If you are pulling elasticsearch-oss and kibana-oss images, you should not see anything related to security.

Is the oss version functional?

Yes.

I can certainly try the x-pack version if you think it would help.

Not mandatory. It helps if you need security, alerting, monitoring, machine learning, graph, migration assistant...

My guess here is that you did pulled the kibana-oss image. See Install Kibana with Docker | Kibana Guide [8.11] | Elastic

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