kibana服务启动报错Unable to retrieve version information from Elasticsearch nodes

kibana服务启动报错

[ERROR][elasticsearch-service] Unable to retrieve version information from Elasticsearch nodes. security_exception: [security_exception] Reason: missing authentication credentials for REST request [/_nodes?filter_path=nodes.*.version%2Cnodes.*.http.publish_address%2Cnodes.*.ip]

原因:yml文件中没有配置kibana的用户名和密码

但是8.0版本中,elasticsearch.yml 中 xpack.security.enabled 默认值为true,第一次启动会自动生成 elastic 用户的密码,而没有其他 build-in 的密码。

直接执行 ./bin/elasticsearch-setup-passwords 则会报错。

解决方案如下:

1、修改配置文件config/elasticsearch.yml,xpack.security.enabled 改为 false

2、重启elasticsearch服务

3、执行命令,删除密码相关索引

curl -XDELETE 127.0.0.1:9200/.security-7

执行成功会出现如下打印:

{"acknowledged":true}

4、修改配置文件config/elasticsearch.yml,xpack.security.enabled 改为 true

5、重启elasticsearch服务

6、执行命令,设置全部 build-in 的密码(执行时发现此脚本已经标注为 deprecated,后续可能会删除,目前仍可使用)

./bin/elasticsearch-setup-passwords interactive

7、修改配置文件config/kibana.yml

elasticsearch.username: "kibana"
elasticsearch.password: "password"

8、启动kibana,浏览器输入 localhost:5601,使用elastic用户名密码登录

Leave a Comment