HAProxy无法启动
我似乎无法启动HAProxy,有什么想法会导致问题吗?
I can't seem to get my HAProxy to start, any ideas whats causing the problem?
root@haproxy-www:/# service haproxy restart
root@haproxy-www:/# service haproxy status
haproxy.service - HAProxy Load Balancer
Loaded: loaded (/lib/systemd/system/haproxy.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Mon 2017-10-02 17:21:11 AEDT; 4s ago
Docs: man:haproxy(1)
file:/usr/share/doc/haproxy/configuration.txt.gz
Process: 11014 ExecStart=/usr/sbin/haproxy-systemd-wrapper -f ${CONFIG} -p /run/haproxy.pid $EXTRAOPTS (code=exited, status=0/SUCCESS)
Process: 11011 ExecStartPre=/usr/sbin/haproxy -f ${CONFIG} -c -q (code=exited, status=0/SUCCESS)
Main PID: 11014 (code=exited, status=0/SUCCESS)
Oct 02 17:21:11 haproxy-www systemd[1]: haproxy.service: Service hold-off time over, scheduling restart.
Oct 02 17:21:11 haproxy-www systemd[1]: Stopped HAProxy Load Balancer.
Oct 02 17:21:11 haproxy-www systemd[1]: haproxy.service: Start request repeated too quickly.
Oct 02 17:21:11 haproxy-www systemd[1]: Failed to start HAProxy Load Balancer.
root@haproxy-www:/#
这是我的haproxy.cfg文件
Here is my haproxy.cfg file
全局 日志/dev/log local0 记录/dev/log local1通知 chroot/var/lib/haproxy 统计信息套接字/run/haproxy/admin.sock模式660级管理员 统计信息超时30秒 用户代理 组羟基 守护程序
global log /dev/log local0 log /dev/log local1 notice chroot /var/lib/haproxy stats socket /run/haproxy/admin.sock mode 660 level admin stats timeout 30s user haproxy group haproxy daemon
# Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
# Default ciphers to use on SSL-enabled listening sockets.
# For more information, see ciphers(1SSL). This list is from:
# https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
ssl-default-bind-options no-sslv3
defaults
log global
mode tcp
option tcplog
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
frontend www
bind ***.***.***.**:80
default_backend site-backend
backend site-backend
balance roundrobin
mode tcp
server webserver-1 10.240.0.178:80 check
server webserver-2 10.240.0.42:80 check
谢谢=)
我有一个类似的问题可以通过使用以下方法解决:
I had a similar issue that I solved using this:
Haproxy需要写入
/run/haproxy/admin.sock
,但不会创建 您的目录.首先创建目录/run/haproxy/
或设置 统计信息套接字指向其他路径.
Haproxy needs to write to
/run/haproxy/admin.sock
but it wont create the directory for you. Create the directory/run/haproxy/
first or set stats socket to a different path.
来源.