kubernetes上部署Fluentd+Elasticsearch+kibana日志收集系统
1 工具介绍
Fluentd:用于收集、处理、传输日志数据。
Elasticsearch:用于实时查询和解析数据。
Kibana:用于数据可视化。
2 工作流程
Fluentd收集日志,将日志过滤处理后输出到Elasticsearch中,Elasticsearch的watcher插件将异常信息通过邮件发送给相关负责人。Kibana配置上ES服务接口,通过Kibana服务访问即可。3 安装
三个工具全部运行在kubernettes上。
fluentd.yaml配置文件
apiVersion: v1
kind: Pod
metadata:
name: fluentd
spec:
containers:
- name: fluentd-es
image: index.tenxcloud.com/google_containers/fluentd-elasticsearch:1.9
imagePullPolicy: Never
env:
- name: FLUENTD_ARGS
value: -qq
volumeMounts:
- name: containers
mountPath: /var/lib/docker/containers
- name: varlog
mountPath: /varlog
- name: podlog
mountPath: /var/lib/kubelet/pods
volumes:
- name: containers
hostPath:
path: /var/lib/docker/containers
- name: varlog
hostPath:
path: /var/log
- name: podlog
hostPath:
path: /var/lib/kubelet/pods
kind: Pod
metadata:
name: fluentd
spec:
containers:
- name: fluentd-es
image: index.tenxcloud.com/google_containers/fluentd-elasticsearch:1.9
imagePullPolicy: Never
env:
- name: FLUENTD_ARGS
value: -qq
volumeMounts:
- name: containers
mountPath: /var/lib/docker/containers
- name: varlog
mountPath: /varlog
- name: podlog
mountPath: /var/lib/kubelet/pods
volumes:
- name: containers
hostPath:
path: /var/lib/docker/containers
- name: varlog
hostPath:
path: /var/log
- name: podlog
hostPath:
path: /var/lib/kubelet/pods
Elasticsearch-rc.yaml配置文件
apiVersion: v1
kind: ReplicationController
metadata:
name: elasticsearch
labels:
name: elasticsearch-logging
kubernetes.io/cluster-service: "true"
spec:
replicas: 1
selector:
name: elasticsearch-logging
template:
metadata:
name: es
labels:
name: elasticsearch-logging
kubernetes.io/cluster-service: "true"
spec:
containers:
- image: index.tenxcloud.com/google_containers/elasticsearch:1.4
imagePullPolicy: Never
name: elasticsearch-logging
ports:
- name: es-port
containerPort: 9200
- name: es-tran-port
containerPort: 9300
volumeMounts:
- name: es-persistent-storage
mountPath: /data
volumes:
- name: es-persistent-storage
emptyDir: {}
kind: ReplicationController
metadata:
name: elasticsearch
labels:
name: elasticsearch-logging
kubernetes.io/cluster-service: "true"
spec:
replicas: 1
selector:
name: elasticsearch-logging
template:
metadata:
name: es
labels:
name: elasticsearch-logging
kubernetes.io/cluster-service: "true"
spec:
containers:
- image: index.tenxcloud.com/google_containers/elasticsearch:1.4
imagePullPolicy: Never
name: elasticsearch-logging
ports:
- name: es-port
containerPort: 9200
- name: es-tran-port
containerPort: 9300
volumeMounts:
- name: es-persistent-storage
mountPath: /data
volumes:
- name: es-persistent-storage
emptyDir: {}
Elasticsearch-service.yaml配置文件
apiVersion: v1
kind: Service
metadata:
name: elasticsearch-logging
labels:
name: elasticsearch-logging
kubernetes.io/cluster-service: "true"
spec:
# if your cluster supports it, uncomment the following to automatically create
# an external load-balanced IP for the frontend service.
type: NodePort
ports:
# the port that this service should serve on
- port: 9200
targetPort: 9200
nodePort: 30009
# - containerPort: 9200
selector:
name: elasticsearch-logging
metadata:
name: elasticsearch-logging
labels:
name: elasticsearch-logging
kubernetes.io/cluster-service: "true"
spec:
# if your cluster supports it, uncomment the following to automatically create
# an external load-balanced IP for the frontend service.
type: NodePort
ports:
# the port that this service should serve on
- port: 9200
targetPort: 9200
nodePort: 30009
# - containerPort: 9200
selector:
name: elasticsearch-logging
kibana-rc.yaml文件
apiVersion: v1
kind: ReplicationController
metadata:
name: kibana-logging
labels:
name: kibana-logging
kubernetes.io/cluster-service: "true"
spec:
replicas: 1
selector:
name: kibana-logging
template:
metadata:
name: kibana
labels:
name: kibana-logging
kubernetes.io/cluster-service: "true"
spec:
containers:
- image: gcr.io/google_containers/kibana:1.3
name: kibana-logging
imagePullPolicy: Never
env:
- name: "ES_SCHEME"
value: "http"
- name: "ES_HOST"
value: "<your-ip>/api/v1/proxy/namespaces/default/services/elasticsearch-logging/"
ports:
- name: kibana-port
containerPort: 80
kind: ReplicationController
metadata:
name: kibana-logging
labels:
name: kibana-logging
kubernetes.io/cluster-service: "true"
spec:
replicas: 1
selector:
name: kibana-logging
template:
metadata:
name: kibana
labels:
name: kibana-logging
kubernetes.io/cluster-service: "true"
spec:
containers:
- image: gcr.io/google_containers/kibana:1.3
name: kibana-logging
imagePullPolicy: Never
env:
- name: "ES_SCHEME"
value: "http"
- name: "ES_HOST"
value: "<your-ip>/api/v1/proxy/namespaces/default/services/elasticsearch-logging/"
ports:
- name: kibana-port
containerPort: 80
kibana-service.yaml配置文件
apiVersion: v1
kind: Service
metadata:
name: kibana-logging
labels:
name: kibana-logging
kubernetes.io/cluster-service: "true"
spec:
# if your cluster supports it, uncomment the following to automatically create
# an external load-balanced IP for the frontend service.
# type: LoadBalancer
ports:
# the port that this service should serve on
- port: 5601
targetPort: 80
# - containerPort: 9200
selector:
name: kibana-logging
kind: Service
metadata:
name: kibana-logging
labels:
name: kibana-logging
kubernetes.io/cluster-service: "true"
spec:
# if your cluster supports it, uncomment the following to automatically create
# an external load-balanced IP for the frontend service.
# type: LoadBalancer
ports:
# the port that this service should serve on
- port: 5601
targetPort: 80
# - containerPort: 9200
selector:
name: kibana-logging
http://blog.csdn.net/ptmozhu/article/details/52301174
相关推荐
在Vagrant上使用Fluentd + Elasticsearch + Kibana的CentOS。 用法 运行vagrant up启动两个来宾VM。 打开以显示Kibana仪表板。 登录到发送方VM并生成Apache的虚拟访问日志。 $ vagrant ssh sender [vagrant@...
在日志管理领域,传统的ELK(Elasticsearch, Logstash, Kibana)堆栈正逐渐被EFK(Elasticsearch, Fluentd, Kafka)所取代,原因是Logstash在处理大量日志时可能消耗过多内存,而Fluentd在轻量级日志收集方面表现更...
手动的指示按此顺序运行pre-install.sh , download.sh , install.sh 。... /opt/elasticsearch-1.7.2/bin/elasticsearch 运行Kafka zookeeper,然后运行节点上的服务器(例如node0)。 /opt/kafka_2
kibana安装k8s所需的安装包,里面分别包括google_containers-elasticsearch_1.8.tar.gz、google_containers-kibana_1.3.tar.gz、kubernetes-fluentd-elasticsearch.tar.gz,详见安装包,免去docker hub上下载
部署教程:https://qhh.me/2019/09/05/Kubernetes-基于-EFK-技术栈的日志收集实践/ yaml地址:https://github.com/kubernetes/kubernetes/tree/master/cluster/addons/fluentd-elasticsearch 部署教程里面的两个注意...
本资源“Kubernetes离线部署+EFK日志收集资源.rar”提供了在没有互联网连接的情况下安装和配置Kubernetes集群的方案,以及整合EFK(Elasticsearch、Fluentd、Kibana)日志收集系统的方法。下面将详细解释这些知识点...
---version: '2.4'services: elasticsearch: image: ${ELASTICSEARCH_IMAGE} restart: always environment: - 'node.name=HEYJUDE' - 'discovery.type=single-node' - 'bootstrap.memory_lock=true' - 'ES_JAVA_OPTS...
Fluentd是一个强大的开源日志收集工具,能够从各种服务和数据源收集日志,进行过滤、转换,并将其分发到多个存储和处理系统,如Elasticsearch或Minio。其特点是支持广泛的插件、数据缓存机制以及低资源占用,同时...
Kubernetes上的弹性云 注意:Elasticstack中的命名空间已更改为logging 在此存储库中,我们将设置Elasticsearch和Kibana,然后设置Fluentd松紧带在本节中,我们将与Elasticsearch和Kibana一起设置elastitc运算符在您...
6. **监控与日志**:学习如何集成Prometheus、Grafana进行性能监控,以及使用Elasticsearch、Fluentd、Kibana(EFK堆栈)收集和查看日志。 7. **故障排查**:如何通过kubectl、describe、logs、exec等命令诊断问题,...
EFK 平台是指 Elasticsearch、Fluentd 和 Kibana 三个组件的结合,旨在提供一个强大的日志管理和分析系统。下面将详细介绍 EFK 平台的部署过程。 添加 Google Incubator 仓库 在部署 EFK 平台之前,需要添加 ...
Kubernetes 社区提供了一个简化版本 EFK (Elasticsearch, Fluentd, Kibana) 用于收集集群的日志。 - 配置 Elasticsearch 和 Fluentd。 - 配置 Kibana。 - 确保日志收集系统可用。 #### 总结 通过以上步骤,我们...
3. ELK (Elasticsearch, Logstash, Kibana) 和 FLUENTD (Fluentd, Elasticsearch, Kibana) 集群:这两种组合为日志收集、存储和分析提供了完整的解决方案。 五、日志持久化与归档 1. 对于长期存储和合规性要求,...
k8s搭建EFK日志中心需要的部署文件,适用于搭建elasticsearch + fluentd + kibana组成的日志分析平台。适合新手小白直接拿来执行使用的k8s部署脚本文件。因为镜像文件较大,所以需要对应镜像文件的请私聊。此种方案...
在Kubernetes环境中,日志收集是一项至关重要的任务,它涉及到对集群中各种日志源的管理和分析,以确保系统的稳定性和可维护性。本文详细阐述了在Kubernetes集群中实施日志收集的策略和方法。 首先,日志来源分为三...
how to collect logs from your applications, as well as Kubernetes with Elasticsearch, Fluentd, and Kibana stack. Ensuring a service is up and healthy is one of the major responsibilities of DevOps. ...
Elasticsearch + FluentD(Fluent-Bit)+ Kibana 流利位适用于内部服务器。 中继(流利位)用于外部服务器。 FluentD适用于Office Server。流利的位和FluentD 例子$ make -e SSH=sshname rebuild-deploy中继对于...