elasticsearch8.0安裝
- 1.安裝
- 2.啟動
- elasticsearch生成令牌
- kibana驗證
- 登錄elasticsearch
前言
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.csdn.net/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頁面,登錄成功,

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/433250.html
標籤:其他
