[英]Consuming pod logs on Openshift with Filebeat
I've configured filebeat
instance, and when it was running without errors, I've figured out, it does nothing. 我已经配置了
filebeat
实例,当它运行无误时,我发现它什么也没做。
I've found in log the following line: 我在日志中找到以下行:
INFO log/input.go:138 Configured paths: [/var/lib/docker/containers/*/*.log]
Quick check and I've found out, that the difference between openshift
and pure docker
is, that in docker
the directories under /var/lib/docker/containers
contains log files and under openshift
they don't. 快速检查,我发现了,这之间的差别
openshift
和纯docker
是,在docker
下的目录/var/lib/docker/containers
包含日志文件,并在openshift
他们不这样做。
How should I configure filebeat
to work under openshift
? 我应该如何配置
filebeat
在openshift
下openshift
?
AFAIK OpenShift also log out container logs as /var/lib/docker/containers/<hash>/*-json.log
format, refer Viewing available container logs for more details. AFAIK OpenShift还以
/var/lib/docker/containers/<hash>/*-json.log
格式注销容器日志,有关更多详细信息,请参阅查看可用的容器日志 。 If you can not find out at the directory, your docker
log driver
might be configured as journald
, it can check from /etc/sysconfig/docker
. 如果你无法在目录中找到了,你的
docker
log driver
可以配置为journald
,它可以检查从/etc/sysconfig/docker
。
OPTIONS=' --selinux-enabled --log-driver=journald --signature-verification=False'
Then you should change journald
to json-file
for logging into /var/lib/docker/containers/<hash>/*-json.log
. 然后,你应该改变
journald
以json-file
用于登录到/var/lib/docker/containers/<hash>/*-json.log
。
OPTIONS=' --selinux-enabled --log-driver=json-file --signature-verification=False'
you need to restart the docker.service
for taking effect. 您需要重新启动
docker.service
才能生效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.