顧名思義大家都知道kibana只能鍵入一個elasticsearch_hosts 地址,1.假如kibana和es部署同台服務器上,es主節點斷掉 kibana也同樣斷了。
2.x-pack 認證es集群
根據官方文檔介紹 接入一個節點 既不為主節點也不為數據節點 他的工作只為接入kibana提供數據
然后kibana設置連接本地es即可
2.認證可以通過nginx來進行用戶認證
在nginx配置文件主目錄下 代理kibana地址 附上用戶認證
將用戶名密碼 鍵入一個文件內 同上 auth_basic_user_file
nginx -t
nginx -s reload
同樣 head也可以認證
本文介紹官方推薦 x-pack
單節點
有auto 生成隨機密碼和interactive自定義密碼 只能生成一次再次修改需要創建本地超級VIPVIP管理員用戶
然后在kibana主配置文件鍵入 賬號為elastic為最高權限
SVIP超級管理員
bin/elasticsearch-users useradd my_admin -p my_password -r superuser
curl -u my_admin -XPUT 'http://192.168.100.8:37900/_xpack/security/user/elastic/_password?pretty' -H 'Content-Type: application/json' -d'
{
password: "123456"
}'
curl -u elastic 'http://192.168.100.8:37900/_xpack/security/_authenticate?pretty'
多es集群節點
./bin/elasticsearch-certutil ca
./bin/elasticsearch-certutil cert --ca elastic-stack-ca.p12
cp elastic-stack-ca.p12 elastic-certificates.p12 config/
chown es:es elastic-stack-ca.p12 elastic-certificates.p12
chmod 640 elastic-stack-ca.p12 elastic-certificates.p12
如果在ca 和 證書申請階段輸入了密碼
bin/elasticsearch-keystore add xpack.security.transport.ssl.keystore.secure_password
bin/elasticsearch-keystore add xpack.security.transport.ssl.truststore.secure_password
加入keystore秘鑰中
將秘鑰證書 傳值其他節點 證書錯誤會報錯 如果證書不對 可重新申請
curl -u elastic:123456 http://192.168.100.8:37900/_cat/nodes?v
scp -r elasticsearch.keystore elastic-stack-ca.p12 elastic-certificates.p12 root@node2:/home/elasticsearh/config
logstash
kibana
修改elasticsearch.user 和password即可
附上參考鏈接地址
https://blog.csdn.net/weixin_33728708/article/details/88914577
https://mp.weixin.qq.com/s?__biz=MzI5OTIzMTU5NQ==&mid=100000374&idx=1&sn=d7e7ae0cb187367bbd4a7f4e781759a3&chksm=6c98f2725bef7b648c49f16f2df57785835e4036364807b3bfcbab3988cf1b814f1fddb4c912&mpshare=1&scene=23&srcid=0331Xqi0canNnSMDZFeNGRSD&sharer_sharetime=1585646222774&sharer_shareid=6240f770833d6ba6a4f882c374ee58b0#rd