elasticsearch8.0安装
前言
8.0中新功能使用8.0版本的最好先看下。
1.安装
docker pull elasticsearch:8.0.0
docker pull kibana:8.0.0
2.启动
启动elasticsearch、kibana
可以参考另一篇博客[docker安装kibana]、docker安装elasticSearch和head插件(https://blog.youkuaiyun.com/IT_road_qxc/article/details/121856640)
安装完毕后,挂载外部卷启动。
我这里已经安装并配置过了,直接启动容器。
docker start elasticsearch8
docker start kibana8
查看kibana是否启动成功。
访问 ip:5601

elasticsearch生成令牌
进入elasticsearch容器中生成令牌
# 进入容器
docker exec -it elasticsearch8 /bin/bash
# 生成令牌 令牌由30分钟有效期
bin/elasticsearch-create-enrollment-token --scope kibana

kibana验证
# 进入kibana容器中
docker exec -it kibana8 /bin/bash
# 执行生成验证码命令
bin/kibana-verification-code
# 获得的验证码输入之前页面中
Your verification code is: 341 246

输入生成验证码点击验证

到这步算是elasticsearch和kiban8.0自动配置用户名密码验证完成。心细的小伙伴肯定发现kibana.yml与之前的不一样了。
登录elasticsearch
文档中介绍:
If you need to reset the password for the elastic user or other built-in users, run the elasticsearch-reset-password tool. This tool is available in the Elasticsearch /bin directory of the Docker container.
既然知道了咋做了,直接执行即可。
# 进入elastic容器中
docker exec -it elasticsearch8 /bin/bash
# 重置密码
bin/elasticsearch-reset-password --username elastic -i
运行结果:
elasticsearch@ca58f3f716bf:~$ bin/elasticsearch-reset-password -u elastic -i
This tool will reset the password of the [elastic] user.
You will be prompted to enter the password.
Please confirm that you would like to continue [y/N]y
Enter password for [elastic]:
Re-enter password for [elastic]:
Password for the [elastic] user successfully reset.
再次登录kibana页面,登录成功。

本文档详细介绍了如何使用Docker安装Elasticsearch 8.0和Kibana,包括启动容器、生成安全令牌以及进行Kibana验证。同时,展示了如何通过elasticsearch-reset-password工具重置elastic用户的密码,确保安全登录。
570

被折叠的 条评论
为什么被折叠?



