我想在我的 webfaction 服务器上安装 filebeat,以便将 apache 日志发送到托管的 ELK。
我按照说明操作。
filebeat 与 ELK 云的连接非常好。 但是在本地我无法克服这个错误:
[someone@web555 filebeat-6.5.1-linux-x86_64]$ ./filebeat setup
Exiting: error initializing publisher: error initializing processors: 1 error: failed to read process cgroups: open /proc/1/cgroup: no such file or directory
确实没有/proc/1/cgroup 只有一个/proc/cgroups 文件(注意这是一个共享服务器)。
我试图找到一种禁用 cgroups 的方法,但无济于事。
[someone@web555 filebeat-6.5.1-linux-x86_64]$ ./filebeat test output
elasticsearch: https://someoneat.europe-west3.gcp.cloud.es.io:443...
parse url... OK
connection...
parse host... OK
dns lookup... OK
addresses: xx.xxx.xxx.xxx
dial up... OK
TLS...
security: server's certificate chain verification is enabled
handshake... OK
TLS version: TLSv1.2
dial up... OK
talk to server... OK
version: 6.5.1
[someone@web555 filebeat-6.5.1-linux-x86_64]$ ./filebeat test config
Exiting: error initializing publisher: error initializing processors: 1 error: failed to read process cgroups: open /proc/1/cgroup: no such file or directory
如有任何提示,我们将不胜感激(免费试用将在 14 天后到期 :D )
后脚本
只启用了 apache2 模块,我认为禁用系统将跳过此 cgroups 检查。
[someone@web555 filebeat-6.5.1-linux-x86_64]$ ./filebeat modules list
Enabled:
apache2
Disabled:
auditd
elasticsearch
haproxy
icinga
iis
kafka
kibana
logstash
mongodb
mysql
nginx
osquery
postgresql
redis
suricata
system
traefik
最佳答案
感谢Jamie Soriano的评论:
Are you using the add_host_metadata processor? try to disable it, the problem seems to be initializing processors.
确实在 filebeat.yml
中我注释了处理器条目(请注意这是默认启用的)。
#================================ Procesors =====================================
# Configure processors to enhance or manipulate events generated by the beat.
processors:
# - add_host_metadata: ~
# - add_cloud_metadata: ~
现在,如果我测试配置,一切正常:
[someone@web555 filebeat-6.5.1-linux-x86_64]$ ./filebeat test config
Config OK
我不喜欢跳过主机元数据,但我至少可以继续并发送 apache2 日志!
关于linux - Elastic filebeat 6.5.1错误: failed to read process cgroups,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53542451/