我的 haproxy 每隔几分钟就会自动重启,这是设计使然吗?来自系统日志:
Aug 23 04:24:31 localhost haproxy[64543]: [NOTICE] 235/042431 (64543) : New worker #1 (64544) forked
Aug 23 04:24:38 api-lb systemd[1]: haproxy.service: Succeeded.
Aug 23 04:51:11 api-lb systemd[1]: haproxy.service: Main process exited, code=exited, status=137/n/a
Aug 23 04:51:11 api-lb systemd[1]: haproxy.service: Failed with result 'exit-code'.
Aug 23 04:51:11 api-lb systemd[1]: haproxy.service: Scheduled restart job, restart counter is at 1.
Aug 23 04:52:17 api-lb systemd[1]: haproxy.service: Main process exited, code=exited, status=137/n/a
Aug 23 04:52:17 api-lb systemd[1]: haproxy.service: Failed with result 'exit-code'.
Aug 23 04:52:18 api-lb systemd[1]: haproxy.service: Scheduled restart job, restart counter is at 2.
Aug 23 04:56:15 api-lb systemd[1]: haproxy.service: Main process exited, code=exited, status=137/n/a
Aug 23 04:56:15 api-lb systemd[1]: haproxy.service: Failed with result 'exit-code'.
Aug 23 04:56:16 api-lb systemd[1]: haproxy.service: Scheduled restart job, restart counter is at 3.
Aug 23 04:56:36 api-lb systemd[1]: haproxy.service: Main process exited, code=exited, status=137/n/a
Aug 23 04:56:36 api-lb systemd[1]: haproxy.service: Failed with result 'exit-code'.
Aug 23 04:56:36 api-lb systemd[1]: haproxy.service: Scheduled restart job, restart counter is at 4.
Aug 23 04:59:19 api-lb systemd[1]: haproxy.service: Main process exited, code=exited, status=137/n/a
Aug 23 04:59:19 api-lb systemd[1]: haproxy.service: Failed with result 'exit-code'.
Aug 23 04:59:19 api-lb systemd[1]: haproxy.service: Scheduled restart job, restart counter is at 5.
Aug 23 05:00:20 api-lb systemd[1]: haproxy.service: Main process exited, code=exited, status=137/n/a
Aug 23 05:00:20 api-lb systemd[1]: haproxy.service: Failed with result 'exit-code'.
Aug 23 05:00:21 api-lb systemd[1]: haproxy.service: Scheduled restart job, restart counter is at 6.
Aug 23 05:01:15 api-lb systemd[1]: haproxy.service: Main process exited, code=exited, status=137/n/a
Aug 23 05:01:15 api-lb systemd[1]: haproxy.service: Failed with result 'exit-code'.
Aug 23 05:01:15 api-lb systemd[1]: haproxy.service: Scheduled restart job, restart counter is at 7.
Aug 23 05:04:15 api-lb systemd[1]: haproxy.service: Main process exited, code=exited, status=137/n/a
Aug 23 05:04:15 api-lb systemd[1]: haproxy.service: Failed with result 'exit-code'.
Aug 23 05:04:15 api-lb systemd[1]: haproxy.service: Scheduled restart job, restart counter is at 8.
Aug 23 05:05:23 api-lb systemd[1]: haproxy.service: Main process exited, code=exited, status=137/n/a
Aug 23 05:05:23 api-lb systemd[1]: haproxy.service: Failed with result 'exit-code'.
Aug 23 05:05:24 api-lb systemd[1]: haproxy.service: Scheduled restart job, restart counter is at 9.
它在 Ubuntu 20.04.1 LTS 下运行,HA-Proxy 版本为 2.0.13-2 2020/04/01 -https://haproxy.org/,主要配置为:
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
stats timeout 30s
maxconn 80000
user haproxy
group haproxy
daemon
# Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
# See: https://ssl-config.mozilla.org/#server=haproxy&server-version=2.0.3&config=intermediate
ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
maxconn 80000
retries 3
有什么想法吗?我们只是不想丢失统计数据,因为每次重启都会减少统计数据。谢谢