Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EFK日志收集fluentd无法读取日志 #219

Open
jinnery opened this issue Sep 11, 2023 · 0 comments
Open

EFK日志收集fluentd无法读取日志 #219

jinnery opened this issue Sep 11, 2023 · 0 comments

Comments

@jinnery
Copy link

jinnery commented Sep 11, 2023

EFK文章部分,配置有问题。默认如下配置是没权限读取的

/var/log/containers下面的日志文件是软连接,挂载到容器里面根本读不到。

原始文件是在/var/lib/docker/containers下面。 还需要挂载这个目录.

##########原始内容############
containers:
- name: fluentd
image: quay.io/fluentd_elasticsearch/fluentd:v3.4.0
volumeMounts:
- name: fluentconfig
mountPath: /etc/fluent/config.d
- name: varlog
mountPath: /var/log
volumes:
- name: fluentconfig
configMap:
name: fluentd-conf
- name: varlog
hostPath:
path: /var/log

##############修改后##############
containers:
- name: fluentd
image: quay.io/fluentd_elasticsearch/fluentd:v3.4.0
volumeMounts:
- name: fluentconfig
mountPath: /etc/fluent/config.d
- name: varlog
mountPath: /var/log
- name: containerlog
mountPath: /var/lib/docker/containers
volumes:
- name: fluentconfig
configMap:
name: fluentd-conf
- name: varlog
hostPath:
path: /var/log
- name: containerlog
hostPath:
path: /var/lib/docker/containers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant