What is the correct way to start up elasticsearch & kibana and connect them under docker swarm

I will post most relevant info from my docker-compose.yml. Please look at the following:

services:
  es-1:
    hostname: es-1
    environment:
      - ELASTIC_PASSWORD=${ADMIN_PASSWORD}
      - node.name=es-1
      - cluster.name=es-docker-cluster
      - discovery.seed_hosts=es-2,es-3
      - cluster.initial_master_nodes=es-1,es-2,es-3
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
      - xpack.security.enabled=false
   es-2: ...
   es-3: ...

  kibana:
    image: docker.elastic.co/kibana/kibana:8.1.2
    environment:      
      - ELASTICSEARCH_USERNAME=elastic
      - ELASTICSEARCH_PASSWORD=${ADMIN_PASSWORD}
      - ELASTICSEARCH_HOSTS=["http://es-1:9200","http://es-2:9200","http://es-3:9200"]

The problem is the super user elastic is not allowed in kibana. Is there any other build-in user I can use to make a quick connection between elastic and kibana?

By the way, all of my services run behind a reverse proxy service (traefik).

I'm new to this, just try to make it work and see what I can get out of it.

Thank you.

Edit:
My workaround is to change the password of build-in user kibana_system after Elasticsearch started, then use that user to initialize kibana. But I hope I can set the password of kibana_system in environment variable somehow.

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