Fluentd给出错误:启动服务器时,日志文件不可写 [英] Fluentd gives the error: Log file is not writable, when starting the server
问题描述
这是我的td-agent.conf文件
Here's my td-agent.conf file
<source>
@type http
port 8888
</source>
<match whatever.access>
@type file
path /var/log/what.txt
</match>
但是当我尝试使用来启动服务器时
But when I try to start the server using
sudo /etc/init.d/td-agent start
它给出了以下错误:
'2016-02-01 10:45:49 +0530 [错误]:fluent/supervisor.rb:359:> main_process中的救援:配置错误文件="/etc/td-agent/td-agent.conf "error =" out_file:>
/var/log/what.txt.20160201_0.log
不可写"
有人可以解释出什么问题吗?
Can someone explain what's wrong?
推荐答案
如果安装了td-agent v2
,它将创建自己的用户和组,称为td-agent
.我相信,当您运行td-agent
服务时,它将切换到该用户,因此它期望目录对该用户具有写权限.我遇到了同样的问题,并做了类似的事情:(如果需要以下命令,请使用sudo
.)
If you installed td-agent v2
, it creates its own user and group called td-agent
. I believe that when you run the td-agent
service, it switches to this user and hence it expects the directory to have write permissions for this user. I faced the same issue and did something like: (Use sudo
if needed for below commands.)
mkdir /logs
chown td-agent:td-agent /logs
并将您的版块更新为:
<match whatever.access>
@type file
path /logs/what.txt
</match>
这篇关于Fluentd给出错误:启动服务器时,日志文件不可写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!