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

相关文章
相关标签/搜索