本文链接地址: Kubernetes EFK(Elastic Search, Fluentd, Kibana)搭建 - 慢慢的回味
上一次,我们完成了搭建单节点Kubernetes环境。现在在其基础上继续搭建EFK(Elastic Search, Fluentd, Kibana)日志收集系统。
目录
Elasticarch 安装Kibana 安装Fluentd 安装Kibana 管理界面Elasticarch 安装Elasticarch 安装时需要开启HTTPS。
kubectl create namespace efk cat <<EOF > es_extracfg.yaml xpack: curity: enabled: "true" authc: api_key: enabled: "true"EOF helm upgrade --install my-elasticarch bitnami/elasticarch -n efk --t curity.enabled=true --t curity.elasticPassword=YourPassword --t curity.tls.autoGenerated=true --t-file extraConfig=es_extracfg.yaml
需要修改Stateful Set “my-elasticarch-coordinating-only”和“my-elasticarch-master”的内容如下,否则数据传输不成功:
resources: requests: cpu: 25m memory: 512Mi
Kibana 安装
Kibana 安装的时候需要指定Elastic Search服务器的地址,密码为Elastic Search服务器的密码。这儿必须连接HTTPS接口。
helm upgrade --install my-kibana bitnami/kibana -n efk --t elasticarch.hosts[0]=my-elasticarch-coordinating-only --t elasticarch.port=9200 --t elasticarch.curity.auth.enabled=true --t elasticarch.curity.auth.kibanaPassword=YourPassword --t elasticarch.curity.tls.enabled=true --t elasticarch.curity.tls.verificationMode=none
Fluentd 安装
手动添加如下配置,通过@type elasticarch把日志转发到Elastic Search服务器上面。
kind: ConfigMapapiVersion: v1metadata: name: elasticarch-output namespace: efkdata: fluentd.conf: | # Prometheus Exporter Plugin # input plugin that exports metrics <source> @type prometheus port 24231 </source> # input plugin that collects metrics from MonitorAgent <source> @type prometheus_monitor <labels> host ${hostname} </labels> </source> # input plugin that collects metrics for output plugin <source> @type prometheus_output_monitor <labels> host ${hostname} </labels> </source> # Ignore fluentd own events <match fluent.**> @type null </match> # TCP input to receive logs from the forwarders <source> @type forward bind 0.0.0.0 port 24224 </source> # HTTP input for the liveness and readiness probes <source> @type http bind 0.0.0.0 port 9880 </source> # Throw the healthcheck to the standard output instead of forwarding it <match fluentd.healthcheck> @type stdout </match> # Send the logs to the standard output <match **> @type elasticarch include_tag_key true scheme https host my-elasticarch-coordinating-only port 9200 ur elastic password YourPassword ssl_verify fal logstash_format true logstash_prefix k8s request_timeout 30s <buffer> @type file path /opt/bitnami/fluentd/logs/buffers/logs.buffer flush_thread_count 2 flush_interval 5s </buffer> </match>
helm upgrade --install my-fluentd bitnami/fluentd -n efk --t aggregator.configMap=elasticarch-output
Kibana 管理界面
添加Index Pattern后可以查看log
本文发布于:2023-02-28 20:06:00,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/zhishi/a/167765606776422.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:fluent安装(fluent安装包).doc
本文 PDF 下载地址:fluent安装(fluent安装包).pdf
留言与评论(共有 0 条评论) |