Filebeat :数据路径已被另一个节拍锁定。请确保多个节拍不共享相同的数据路径

查看其中一个 filebeat pod 中的日志,我可以看到:

2021-01-04T10:10:52.754Z        DEBUG   [add_cloud_metadata]    add_cloud_metadata/providers.go:129     add_cloud_metadata: fetchMetadata ran for 2.351101ms
2021-01-04T10:10:52.754Z        INFO    [add_cloud_metadata]    add_cloud_metadata/add_cloud_metadata.go:93     add_cloud_metadata: hosting provider type detected as openstack, metadata={"ava
ilability_zone":"us-east-1c","instance":{"id":"i-08f536567bd9945df","name":"ip-10-101-2-178.ec2.internal"},"machine":{"type":"m5.2xlarge"},"provider":"openstack"}
2021-01-04T10:10:52.755Z        DEBUG   [processors]    processors/processor.go:120     Generated new processors: add_cloud_metadata={"availability_zone":"us-east-1c","instance":{"id":"i-08f5
36567bd9945df","name":"ip-10-101-2-178.ec2.internal"},"machine":{"type":"m5.2xlarge"},"provider":"openstack"}, add_docker_metadata=[match_fields=[] match_pids=[process.pid, process.ppid]]    
2021-01-04T10:10:52.755Z        INFO    instance/beat.go:392    filebeat stopped.
2021-01-04T10:10:52.755Z        ERROR   instance/beat.go:956    Exiting: data path already locked by another beat. Please make sure that multiple beats are not sharing the same data path (pat
h.data).
Exiting: data path already locked by another beat. Please make sure that multiple beats are not sharing the same data path (path.data).

如您所见,filebeat 因错误而停止:

data path already locked by another beat. Please make sure that multiple beats are not sharing the same data path (path.data).

在 github/forum 中搜索问题后,我发现:
https://discuss.elastic.co/t/data-path-already-locked-by-another-beat/219852/4

这看起来像我的问题,我使用默认的 filebeat-kubernetes.yaml ,ELK / Filebeats 文档中没有关于如何在 filebeat-kubernetes.yaml 中添加唯一路径的信息
我在哪里添加它们以及如何使它们独一无二?谢谢

stack overflow Filebeat : data path already locked by another beat. Please make sure that multiple beats are not sharing the same data path
原文答案
author avatar

接受的答案

我有同样的问题。这意味着您的数据路径(/var/lib/filebeats)被另一个 filebeat 实例锁定。因此,执行 sudo systemctl stop filebeat (在我的情况下)以确保您没有运行 filebeat,然后使用 sudo filebeat -e 运行 filebeat,它会在控制台中打印日志

我也试过你分享的链接,但它对我没有帮助。这里有另一种解决方案,可能会对您有所帮助: https://discuss.elastic.co/t/data-path-already-locked-by-another-beat/219852/2


答案:

作者头像

除了@Anton 的 answer ,在其中一个场景中,我在数据路径中有一个锁文件。这可能是 /var/lib/filebeat/filebeat.lock ,具体取决于配置。删除文件并运行 sudo filebeat -e

作者头像

如果您想将弹性堆栈作为服务运行,则该解决方案只是以此顺序重新启动所有堆栈:

  • Elasticsearch
    *基巴纳
  • logstash
  • filebeat(s)

this link 中已经建议。

相关问题