3.安裝可視化工具kibana

做者

微信:tangy8080
電子郵箱:914661180@qq.com
更新時間:2019-06-19 10:10:42 星期三nginx

歡迎您訂閱和分享個人訂閱號,訂閱號內會不按期分享一些我本身學習過程當中的編寫的文章
如您在閱讀過程當中發現文章錯誤,可添加個人微信 tangy8080 進行反饋.感謝您的支持。
git

文章主題

安裝Kibana來查看ElasticSearch中的數據github

前置條件

完成了本章節的第一,第二節shell

安裝kibana

建立受權文件

因爲kibana免費版本不提供認證功能,因此在這裏咱們使用Basic Authentication來完成一個簡單的用戶認證微信

#安裝httpd,用於生成認證文件
yum -y install httpd

#建立用戶
echo "$(htpasswd -nb -C 5 kibana yourpassword)" >> auth

#在k8s中建立保密字典
kubectl create secret generic basic-auth --from-file=auth
  • It's important the file generated is named auth (actually - that the secret has a key data.auth), otherwise the ingress-controller returns a 503.
  • 參考連接:https://kubernetes.github.io/ingress-nginx/examples/auth/basic/

安裝

helm install --name kibana --set image.tag=6.7.0,persistentVolumeClaim.storageClass=nfs-client,env."ELASTICSEARCH_HOSTS"="http://elasticsearch-client:9200",ingress.enabled=true,ingress.hosts[0]="kibana.honeysuckle.site",ingress.annotations."kubernetes\.io/ingress\.class"="nginx",ingress.annotations."nginx\.ingress\.kubernetes\.io/auth-type"="basic",ingress.annotations."nginx\.ingress\.kubernetes\.io/auth-secret"="basic-auth",ingress.annotations."nginx\.ingress\.kubernetes\.io/auth-realm"="'Authentication Required - kibana'",ingress.tls[0].hosts[0]=kibana.honeysuckle.site,ingress.tls[0].secretName="ingress-secret"  stable/kibana
  • kibana的版本應該ElasticSearch的版本一致,https://github.com/elastic/kibana#version-compatibility-with-elasticsearch
  • 6.6版本移除了elasticsearch.url,需使用elasticsearch.hosts
  • ingress.enabled=true 啓用ingress
  • ingress.annotations 使用nginx做爲ingress控制器,而且添加了認證參數
  • 這裏使用了ssl鏈接,若有疑問.可參閱:https://www.showdoc.cc/honeysuckle?page_id=2275371802808473
  • 當您使用basic-auth時,建議使用tls,不然您的用戶名和密碼可能會被竊聽,若您沒有條件支持tls,可刪除ingress.tls相關的參數

一些就緒以後,可使用http://kibana.honeysuckle.site 打開kibana的Web界面
app

認證經過以後,添加一個索引匹配模式以後應該就能夠看到es中的日誌了
elasticsearch

[按需]卸載
helm del --purge kibana

遇到的問題

  • Another Kibana instance appears to be migrating the index.


https://github.com/elastic/kibana/issues/25806學習

  • EsRejectedExecutionException
    緣由: 說明ES索引數據的速度已經跟不上client端發送bulk請求的速度,請求隊列已滿以至開始拒絕新的請求。 這是ES集羣的自我保護機制。能夠適當睡眠一段時間或者將隊列設置大點。默認設置是 bulk thead pool set queue capacity =50 能夠設置大點。ui

  • 更改時間的顯示格式YYYY-MM-DD, HH:mm:ss.SSS
    url

引用連接

https://github.com/elastic/kibana/issues/25806 https://github.com/elastic/kibana#version-compatibility-with-elasticsearch

相關文章
相關標籤/搜索