本文介绍了ELASTIC_PASSWORD_FILE 在 Kibana 容器中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在环境下的 Kibana 容器中使用 ELASTIC_PASSWORD_FILE.但是,它似乎无法读取该值.有什么建议吗?

I have tried use ELASTIC_PASSWORD_FILE in Kibana container under environment. However, it seeems like it cant read the value. Any suggestion?

version: "3.9"
services:
  kibana:
    image: docker.elastic.co/kibana/kibana:7.14.0
    secrets:
      - es_password
    environment:
      - ELASTIC_PASSWORD=/run/secrets/es_password
    volumes:
      - type: bind
        source: ./kibana.yml
        target: /usr/share/kibana/config/kibana.yml

secrets:
  es_password:
    file: ./.password

kibana.yml

elasticsearch.password: '${ELASTIC_PASSWORD}'

推荐答案

您需要将 xpack.security.enabled 设置为true";env 变量也是如此.

You need to set xpack.security.enabled as "true" env variable as well.

像这样:

environment:
      xpack.security.enabled: "true"
      ELASTICSEARCH_PASSWORD: <your_password>

这里有更多信息:https://discuss.elastic.co/t/how-to-set-passwords-for-built-in-users-with-docker-compose-setup/198096/3

这篇关于ELASTIC_PASSWORD_FILE 在 Kibana 容器中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 01:20