簡體   English   中英

如何在 ECK 上為 kafka 輸入配置 Filebeat?

[英]How to configure Filebeat on ECK for kafka input?

我有 Elasticsearch 和 Kibana 在 Kubernetes 上運行。 兩者均由 ECK 創建。 現在我嘗試將 Filebeat 添加到其中並將其配置為索引來自 Kafka 主題的數據。 這是我目前的配置:

apiVersion: beat.k8s.elastic.co/v1beta1
kind: Beat
metadata:
   name: my-filebeat
   namespace: my-namespace
spec:
   type: filebeat
   version: 7.10.2
   elasticsearchRef:
       name: my-elastic
   kibanaRef:
       name: my-kibana
   config:
       filebeat.inputs:
       - type: kafka
         hosts:
         - host1:9092
         - host2:9092
         - host3:9092
         topics: ["my.topic"]
         group_id: "my_group_id"
         index: "my_index"
   deployment:
       podTemplate:
           spec:
               dnsPolicy: ClusterFirstWithHostNet
               hostNetwork: true
               securityContext:
                   runAsUser: 0
               containers:
               - name: filebeat

在 pod 的日志中,我可以看到如下條目

log/log.go:145  Non-zero metrics in the last 30s    {"monitoring": {"metrics": {"beat":{"cpu":{"system":{"ticks":2470,"time":{"ms":192}},"total":{"ticks":7760,"time":{"ms":367},"value":7760},"user":{"ticks":5290,"time":{"ms":175}}},"handles":{"limit":{"hard":1048576,"soft":1048576},"open":13},"info":{"ephemeral_id":"5ce8521c-f237-4994-a02e-dd11dfd31b09","uptime":{"ms":181997}},"memstats":{"gc_next":23678528,"memory_alloc":15320760,"memory_total":459895768},"runtime":{"goroutines":106}},"filebeat":{"harvester":{"open_files":0,"running":0},"inputs":{"kafka":{"bytes_read":46510,"bytes_write":37226}}},"libbeat":{"config":{"module":{"running":0}},"pipeline":{"clients":1,"events":{"active":0}}},"registrar":{"states":{"current":0}},"system":{"load":{"1":1.18,"15":0.77,"5":0.97,"norm":{"1":0.0738,"15":0.0481,"5":0.0606}}}}}}

也不存在錯誤條目。 所以我假設與 Kafka 的連接有效。 不幸的是,上面指定的 my_index 中沒有數據。 我做錯了什么?

我猜你無法連接到 output 中提到的 Elasticsearch。

根據文檔,ECK 保護部署的 Elasticsearch 並將其存儲在 Kubernetes 機密中。

https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-beat-configuration.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM