k8s部署fluedtd 报错无法读取日志

2019-11-28 00:53:54 +0000 [warn]: [fluentd-containers.log] /var/log/containers/es-cluster-2_logging_elasticsearch-aac85521845973fed5f6d07ac46a204214edeb9e2d21c0ea8ed6fda726960b5a.log unreadable. It is excluded and would be examined next time.

root@master01 ~]# kubectl get pods -n logging
NAME READY STATUS RESTARTS AGE
es-cluster-0 1/1 Running 0 4d12h
es-cluster-1 1/1 Running 0 4d12h
es-cluster-2 1/1 Running 0 4d12h
fluentd-es-v2.7.0-4r5dl 1/1 Running 0 21h
fluentd-es-v2.7.0-bgj7g 1/1 Running 0 21h
fluentd-es-v2.7.0-klvtl 1/1 Running 0 21h
fluentd-es-v2.7.0-xx49h 1/1 Running 0 21h
kibana-74896b9bdf-h24rf 1/1 Running 1 3d18h

[root@master01 ~]# kubectl exec -it fluentd-es-v2.7.0-bgj7g -n logging – /bin/bash

在这里插入图片描述因此,实际上这些日志文件存储在 /var/log/pods/
我能够通过改变hostPath挂载解决这个问题containers,以 /var/log/pods/

这个问题起初是想更改containers存放在其它位置,没有成功

解决办法:更改configmap文件里的
fluentd-containers.log 的path文件路径

你可能感兴趣的:(k8s)