HAProxy - 它是否缓存配置文件

HAProxy - Does it cache the configuration file

我不确定 post 这个地方是否正确。如果不是,请告诉我。

基本上,就是问题的标题。我有一个 haproxy 配置文件,我试图将超时设置为 3600s。但是,文件似乎会随机恢复到上一次迭代,超时值要短得多。

我设置的是这样的:

defaults
  log     global
  mode    http
  retries 3
  timeout client 3600s
  timeout connect 3600s
  timeout server 3600s
  option tcplog
  balance  roundrobin

listen admin
  bind 127.0.0.1:22002
  mode http
  stats enable
  stats show-node
  stats uri  /admin

listen  stats    :1936
  mode            http
  log             global

  maxconn 10

  timeout client 3600s
  timeout connect 3600s
  timeout server 3600s
  timeout queue   3600s

  stats enable
  stats hide-version
  stats show-node
  stats uri  /haproxy?stats

但是,它以某种方式更改为以下内容:

defaults
  log     global
  mode    http
  retries 3
  timeout client 50s
  timeout connect 5s
  timeout server 50s
  option tcplog
  balance  roundrobin

listen admin
  bind 127.0.0.1:22002
  mode http
  stats enable
  stats show-node
  stats uri  /admin

listen  stats    :1936
  mode            http
  log             global

  maxconn 10

  clitimeout      100s
  srvtimeout      100s
  contimeout      100s
  timeout queue   100s

  stats enable
  stats hide-version
  stats show-node
  stats uri  /haproxy?stats

我没有发现任何迹象表明 haproxy 1.5 缓存了配置文件,但我需要调查所有可能性。简单地说:haproxy中有什么东西可以导致这个吗?

据我所知,HAProxy 没有实现任何可以解释该行为的东西。

HAProxy 是如何安装的?你的 OS 是多少?

如果你的服务器上有 auditd,你可以添加一个规则来监视哪个进程正在修改配置文件:

auditctl -w /etc/haproxy/haproxy.conf -p wa

然后观察 /var/log/audit/audit.log 中的任何 activity。

要删除审核:

    auditctl -W /etc/haproxy/haproxy.conf