Kibana8.3

windows的安装

Install Kibana on Windows | Kibana Guide [8.3] | Elastic

启动

解压并从控制台进入目录,执行下面命令

/bin/kibana.bat

配置

方式1:通过 enrollment-token (一次性的配置token,30分钟有效)

首先需要获得token,在es创建的时候会输出到控制台(我是docker启动,反正是没看到)

可以手动生成,文章如下

elasticsearch-create-enrollment-token | Elasticsearch Guide [8.3] | Elastic

命令参考

bin/elasticsearch-create-enrollment-token -s kibana --url "https://172.0.0.3:9200"

--url 不是必须,默认会使用本机的IP,这在docker下不友好,生成的enrollment-token带上了docker的ip,导致在使用的时候,会去连docker的ip,所以会出现连不上的情况,

但是,如果指定--url,会出现下面的错误

java.security.cert.CertificateException: No subject alternative names matching IP address 111.21.152.160 found

所以用不用--url,这条路在windows上都不容易走通

方式2:通过账号密码

首先是输入地址,http://localhost:5601

然后要求输入账号密码,账号密码不能使用默认的elastic,需要重新生成一个,生成的文章如下

elasticsearch-reset-password | Elasticsearch Guide [8.3] | Elastic

参数

-a, --auto
Resets the password of the specified user to an auto-generated strong password. (Default)
-b, --batch
Runs the reset password process without prompting the user for verification.
-E <KeyValuePair>
Configures a standard Elasticsearch or X-Pack setting.
-f, --force
Forces the command to run against an unhealthy cluster.
-h, --help
Returns all of the command parameters.
-i, --interactive
Prompts for the password of the specified user. Use this option to explicitly set a password.
-s --silent
Shows minimal output in the console.
-u, --username
The username of the native realm user or built-in user.
--url
Specifies the base URL (hostname and port of the local node) that the tool uses to submit API requests to Elasticsearch. The default value is determined from the settings in your elasticsearch.yml file. If xpack.security.http.ssl.enabled is set to true, you must specify an HTTPS URL.
-v --verbose
Shows verbose output in the console.

示例

bin/elasticsearch-reset-password --url "https://172.0.0.3:9200" --username user2 -i

注意 --url 可以不用

输入后,提示如下

Couldn't configure Elastic 
Retry or update the kibana.yml file manually.

这个时候,只能手动设置kibana.yml

# =================== System: Elasticsearch ===================
# The URLs of the Elasticsearch instances to use for all your queries.
elasticsearch.hosts: ["https://xx.xx.xx.xx:9200"]

# If your Elasticsearch is protected with basic authentication, these settings provide
# the username and password that the Kibana server uses to perform maintenance on the Kibana
# index at startup. Your Kibana users still need to authenticate with Elasticsearch, which
# is proxied through the Kibana server.
elasticsearch.username: "zzzz"
elasticsearch.password: "xxxxx"

再次尝试启动,报如下错误

 Elasticsearch self signed certificate in certificate chain

找到elasticsearch.ssl.verificationMode,设置为none

elasticsearch.ssl.verificationMode: none

再次尝试启动

启动成功

登录

打开http://localhost:5601

输入账号密码,提示没有权限,

这里要注意,使用上面生成的账号是没有用的,这个账号只是用于perform maintenance,没有权限

最直接的方式是使用账号elastic