Docker部署ELK之部署kibana7.6.0(2)
1. 拉取kibana镜像
sudo docker pull kibana:7.6.0
2. 输入命令构建kibana容器,关于挂载kibana配置文件的问题,也可以先构建一个容器,然后把配置文件copy到主机,然后再挂载容器用,参考上一篇
docker run --name kibana01 -d -p 5601:5601 -v /home/xujk/Work/Docker/elasticsearch/kibana/config/kibana.yml:/kibana/config/kibana.yml --network=mynetwork --ip 172.18.0.5 --link elasticsearch:es1 -e ELASTICSEARCH_HOSTS=http://172.18.0.4:9200 kibana:7.6.0
报错:
License information from the X-Pack plugin could not be obtained from Elasticsearch
参考解决url:https://blog.csdn.net/cominglately/article/details/99744523
分析:配置elasticsearch auth认证之后,发现kibana无法访问,没有配置kibana的认证用户
3. elasticsearch开启x-pack验证
修改配置文件:
cd /home/xujk/Work/Docker/elasticsearch/es7.6.0/config
sudo gedit elasticsearch.yml
进入到elasticsearch容器内部,设置用户名和密码:
sudo docker exec -it es1 bash
bin/elasticsearch-setup-passwords interactive
修改密码命令可参考:
curl -H "Content-Type:application/json" -XPOST -u elastic 'http://172.18.0.4:9200/_xpack/security/user/elastic/_password' -d '{ "password" : "123456" }'