Não é possível fazer o Haproxy UP sempre que a seção "Listen" for adicionada no arquivo de configuração. Apontar para abrir o Haproxy Stats, mas não é capaz de alcançar através de configurações abaixo.
Eu não sei onde estou fazendo errado.
Configuração estatística do HAproxy no Ubuntu 16.04.2 LTS.
haproxy -version
+++++++++++++++++
HA-Proxy version 1.6.3 2015/12/25
haproxy.cfg
+++++++++++
global
log 127.0.0.1 local2 #Log Configuration
chroot /var/lib/haproxy
pidfile /run/haproxy.pid
maxconn 4000
user haproxy #Haproxy running under user and group "Haproxy"
group haproxy
daemon
#turn on stats unix socket
stats socket /var/lib/haproxy/stats
defaults
mode http
log global
option httplog
option dontlognull
option http-server-close
option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000
listen haproxy-monitoring
bind :8080 #Haproxy Monitoring RUN on port 8080
mode http
option forwardfor
option httpclose
stats enable
stats show-legends
stats refresh 5s
stats uri /stats #URL for HAproxy monitoring
stats realm Haproxy\ Statistics
stats auth admin:admin
stats admin if TRUE
default_backend haproxy_http
frontend http
bind *:90
option https-server-close
option forwardfor
default_backend haproxy_http
backend haproxy_http
balance roundrobin
option httpchk HEAD / HTTP/1.1\r\nHOST:\ localhost #Check Health
server server-1 192.168.1.124:80 check
server server-2 192.168.1.123:80 check
Após iniciar o HAproxy, Abaixo do erro.
Error:
++++++
haproxy.service - HAProxy Load Balancer
Loaded: loaded (/lib/systemd/system/haproxy.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Thu 2018-02-15 21:27:55 IST; 14s ago
Docs: man:haproxy(1)
file:/usr/share/doc/haproxy/configuration.txt.gz
Process: 1486 ExecStartPre=/usr/sbin/haproxy -f ${CONFIG} -c -q (code=exited, status=1/FAILURE)
Feb 15 21:27:55 loadbal systemd[1]: haproxy.service: Control process exited, code=exited status=1
Feb 15 21:27:55 loadbal systemd[1]: Failed to start HAProxy Load Balancer.
Feb 15 21:27:55 loadbal systemd[1]: haproxy.service: Unit entered failed state.
Feb 15 21:27:55 loadbal systemd[1]: haproxy.service: Failed with result 'exit-code'.
Feb 15 21:27:55 loadbal systemd[1]: haproxy.service: Service hold-off time over, scheduling restart.
Feb 15 21:27:55 loadbal systemd[1]: Stopped HAProxy Load Balancer.
Feb 15 21:27:55 loadbal systemd[1]: haproxy.service: Start request repeated too quickly.
Feb 15 21:27:55 loadbal systemd[1]: Failed to start HAProxy Load Balancer.
Por favor, ajude-me a resolver este problema para obter a estatística HAproxy.
Tags haproxy