Install Kibana with Docker
-
拉取镜像
docker pull docker.elastic.co/kibana/kibana:7.12.0
-
运行并添加容器后台运行,指定Elasticsearch地址为http://localhost:9200
docker run --name kib01 -d -p 5601:5601 -e "ELASTICSEARCH_HOSTS=http://localhost:9200" docker.elastic.co/kibana/kibana:7.12.0
-
设置连接Elasticsearch的用户名和密码
进入容器
docker exec -it kib01 /bin/bash
编辑配置文件
vi config/kibana.yml
添加内容
elasticsearch.username: kibana_system
From the directory where you installed Kibana, run the following commands to create the Kibana keystore and add the secure settings:
Create the Kibana keystore:
./bin/kibana-keystore create
Add the password for the kibana_system user to the Kibana keystore:
./bin/kibana-keystore add elasticsearch.password
When prompted, enter the password for the kibana_system user.
4. 重启容器
docker restart kib01
参考链接:
- [https://www.elastic.co/guide/en/kibana/7.12/docker.html](Install Kibana with Docker)
- [https://www.elastic.co/guide/en/elasticsearch/reference/7.12/security-minimal-setup.html#add-built-in-users](Configure Kibana to connect to Elasticsearch with a password)