web-dev-qa-db-ja.com

HAProxyがSYSVの起動に失敗しました

Haプロキシを開始しようとしていますが、成功しません。これがjournalctl-xeからのエラーです:

Oct 18 23:11:27 upload-server polkitd[578]: Registered Authentication Agent for unix-process:2044:11115 (system bus name :1.14 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)
Oct 18 23:11:27 upload-server systemd[1]: Starting SYSV: HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments....
-- Subject: Unit haproxy.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit haproxy.service has begun starting up.
Oct 18 23:11:27 upload-server haproxy[2049]: /etc/rc.d/init.d/haproxy: line 26: [: =: unary operator expected
Oct 18 23:11:27 upload-server haproxy[2053]: Proxy Swift-cluster started.
Oct 18 23:11:27 upload-server haproxy[2053]: Proxy Swift-cluster started.
Oct 18 23:11:27 upload-server haproxy[2049]: Starting haproxy: [ALERT] 291/231127 (2053) : Starting frontend GLOBAL: cannot bind UNIX socket [/run/haproxy/admin.sock]
Oct 18 23:11:27 upload-server haproxy[2049]: [FAILED]
Oct 18 23:11:27 upload-server systemd[1]: haproxy.service: control process exited, code=exited status=1
Oct 18 23:11:27 upload-server systemd[1]: Failed to start SYSV: HA-Proxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments..
-- Subject: Unit haproxy.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit haproxy.service has failed.
-- 
-- The result is failed.
Oct 18 23:11:27 upload-server systemd[1]: Unit haproxy.service entered failed state.
Oct 18 23:11:27 upload-server systemd[1]: haproxy.service failed.
Oct 18 23:11:28 upload-server polkitd[578]: Unregistered Authentication Agent for unix-process:2044:11115 (system bus name :1.14, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)

これが私の/etc/haproxy/haproxy.cfgです

global
   maxconn 4096
   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

defaults
   log global
   mode http
   option httplog
   option dontlognull
   retries 3
   option  redispatch
   maxconn 2000
   timeout connect 5000
   timeout client 50000
   timeout server 50000

listen Swift-cluster
bind 192.168.0.91:80
    mode    http
    stats   enable
    stats   auth haproxy_username:haproxy_password
    balance roundrobin
    option  httpchk HEAD /healthcheck HTTP/1.0
    option  forwardfor
    option  http-server-close
    timeout http-keep-alive 500
    server  proxy1 192.168.0.41:80 weight 5 check inter 2000
    server  proxy2 192.168.0.42:80 weight 5 check inter 2000

私は何が間違っているのですか?

1
Oleksandr

ソケット用のフォルダを作成するのを忘れていたからです。これは私を助けました:

Sudo mkdir -p /run/haproxy
2
Oleksandr