2015-05-07 14 views
11

Sto provando ad avviare haproxy (versione 1.5.8 2014/10/31) con un file di configurazione "vuoto" e ottengo:HAProxy non si avvia, non può associare il socket UNIX [/run/haproxy/admin.sock]

[email protected]:~$ sudo service haproxy start 
[....] Starting haproxy: haproxy[ALERT] 126/120540 (7363) : Starting frontend GLOBAL: cannot bind UNIX socket [/run/haproxy/admin.sock] 

ospitarci è abilitato:

[email protected]:~$ cat /etc/default/haproxy 
# Set ENABLED to 1 if you want the init script to start haproxy. 
ENABLED=1 

file di configurazione:

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 

qualcuno ha un idea del perché esso non può iniziare?

+0

Se rimuovo: "stats socket /run/haproxy/admin.sock mode 660 level admin \ stats timeout 30s", può iniziare –

+0

Qualcuno potrebbe spiegare perché? –

risposta

30

Haproxy deve scrivere su /run/haproxy/admin.sock ma non crea la directory per te. Creare prima la directory /run/haproxy/ o impostare stats socket su un percorso diverso.

+0

Wow ha speso come 4 ore su questo problema. Ta! –

+0

Wow ... Soluzione perfetta ... mi hai salvato la giornata ... !!!! – Siten

+0

Esattamente ... Salva il mio giorno, Saluti ... !!! – Siten

0

Mi sono imbattuto in questo problema e ho dovuto rimuovere il file /run/haproxy/admin.sock per HAProxy per riavviare correttamente. Posso solo pensare che sia stato danneggiato dopo aver annullato un comando yum update. Oops!