docker run --name kibana -e ELASTICSEARCH_HOSTS=http://192.168.xx.xx:9200 -p 5601:5601 -d kibana:7.10.1
参数解释
-
docker run
-
–name kibana -e :指定容器名称
-
ELASTICSEARCH_HOSTS=192.168.xx.xx:9200:指定es地址
-
-p 5601:5601 :指定端口号
-
-d kibana:7.10.1:指定镜像名称
3.更改配置文件 设置xpack
因为上文中,我们的es配置了xpack,所以在连接时候也要设置xpack,此时需要进入docker容器修改配置文件。
1.进入容器
docker exec -it 容器id /bin/bash
2.修改配置文件
cd config
vi kibana.yml
kibana.yml配置
i18n.locale: “zh-CN”
server.port: 5601
server.host: 0.0.0.0
elasticsearch.username: “elastic” #es中配置
elasticsearch.password: “xxxx” #es中配置
xpack.reporting.encryptionKey: “a_random_string”
xpack.s