Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sockets/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sockets HAProxy不';无法启动,无法绑定UNIX套接字[/run/haproxy/admin.sock]_Sockets_Bind_Startup_Haproxy - Fatal编程技术网

Sockets HAProxy不';无法启动,无法绑定UNIX套接字[/run/haproxy/admin.sock]

Sockets HAProxy不';无法启动,无法绑定UNIX套接字[/run/haproxy/admin.sock],sockets,bind,startup,haproxy,Sockets,Bind,Startup,Haproxy,我试图用一个“空”配置文件启动haproxy(版本1.5.8 2014/10/31),我得到: user@server:~$ sudo service haproxy start [....] Starting haproxy: haproxy[ALERT] 126/120540 (7363) : Starting frontend GLOBAL: cannot bind UNIX socket [/run/haproxy/admin.sock] 尽管它已启用: user@server:~$

我试图用一个“空”配置文件启动haproxy(版本1.5.8 2014/10/31),我得到:

user@server:~$ sudo service haproxy start
[....] Starting haproxy: haproxy[ALERT] 126/120540 (7363) : Starting frontend GLOBAL: cannot bind UNIX socket [/run/haproxy/admin.sock]
尽管它已启用:

user@server:~$ cat /etc/default/haproxy 
# Set ENABLED to 1 if you want the init script to start haproxy.
ENABLED=1
配置文件:

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).
    ssl-default-bind-ciphers kEECDH+aRSA+AES:kRSA+AES:+AES256:RC4-SHA:!kEDH:!LOW:!EXP:!MD5:!aNULL:!eNULL
    ssl-default-bind-options no-sslv3

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

有人知道它为什么不能启动吗?

Haproxy需要写入
/run/Haproxy/admin.sock
,但它不会为您创建目录。首先创建目录
/run/haproxy/
,或者将
stats socket
设置为其他路径。

我遇到了这个问题,必须删除
/run/haproxy/admin.sock
文件才能成功重启haproxy。我只能认为,在我中止
yum update
命令后,它已损坏。哎呀 再加上这个。不知道最新的车队

重新启动后,我在/run文件夹中创建的任何内容都会消失。 如果我移动到/var/lib/haproxy而不是/run/haproxy,它将作为root用户手动启动。
如果我重新启动它就会失败。不确定是不是因为它试图在重新启动时使用haproxy?如果我支持haproxy,它会说该帐户不可用,但我认为这是因为它设置为nologin。

如果我删除:“stats socket/run/haproxy/admin.sock mode 660 level admin\stats timeout 30s”,它会开始让人解释为什么?哇,在这个问题上花了大约4个小时。助教!谢谢@datacarl,我为这个问题奋斗了一整天,你的回答解决了我的问题,好几天都一事无成。删除此文件导致某些移动。谢谢