1.X-Pack介紹
X-Pack是Elastic Stack擴展功能,提供安全性,警報,監視,報告,機器學習和許多其他功能。 ES7.0+之后,默認情況下,當安裝Elasticsearch時,會安裝X-Pack,無需單獨再安裝。
自6.8以及7.1+版本之后,基礎級安全永久免費。
 
         
首先關閉 elasticsearch 服務
vim elasticsearch.yml 在最底部追加 下面配置
xpack.security.enabled: true xpack.security.audit.enabled: true xpack.license.self_generated.type: basic xpack.security.transport.ssl.enabled: true

然后 以elastic用戶身份 啟動 elasticsearch 服務
再開一個窗口 用root用戶
bin/elasticsearch-setup-passwords interactive

輸入 y 確認

確認以后 完畢
編輯 ./kibana.yml
elasticsearch.username: "elastic"
elasticsearch.password: "mingdu*****" 
         
啟動 kibana
編輯 elasticsearch.yml
http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type
添加這以配置
重啟 elasticsearch 服務
啟動 elasticsearch-head 服務
http://127.0.0.1:9100/?auth_user=elastic&auth_password=********

