haproxy sendmsg 记录器 #1 失败:没有此文件或目录

haproxy sendmsg 记录器 #1 失败:没有此文件或目录

我收到错误:

[ALERT] 342/125339 (1) : sendmsg logger #1 failed: No such file or directory (errno=2)

/srv/dockervolume/haproxy/etc/rsyslog.d/49-haproxy.conf 文件:

$AddUnixListenSocket /var/lib/haproxy/dev/log

local0.* -/var/log/haproxy/haproxy_0.log
local1.* -/var/log/haproxy/haproxy_1.log

if ($programname == 'haproxy') then -/var/log/haproxy/haproxy.log
& ~

/srv/dockervolume/haproxy/etc/haproxy/haproxy.cfg 文件:

global
    log /var/lib/haproxy/dev/log local0 debug
    chroot /var/lib/haproxy
    maxconn 2048
    tune.ssl.default-dh-param 2048
    stats socket /run/haproxy/admin.sock mode 660 level admin
    stats timeout 30s
    user haproxy
    group haproxy

defaults
    log     global
    mode    http
    option  httplog
    option  dontlognull
    retries 3
    timeout connect 5000
    timeout client  10000
    timeout server  10000

backend my_backend
    log /var/lib/haproxy/dev/log local0 debug

rsyslog 正在运行:

root@haproxy:/# ps aux | grep rsys         
syslog      37  0.0  0.0 116572  1876 ?        Sl+  12:57   0:00 rsyslogd -n -c5

除此之外,haproxy 运行良好!

答案1

我认为你的问题出在路径上,因为你在“/var/lib/haproxy”中 chroot,并且你的套接字是“/var/lib/haproxy/dev/log”,所以日志路径应该只是“/dev/log”

相关内容