HAProxy 1.7 통계 설정 “systemctl status haproxy.service” and “journalctl -xe” for

HAProxy 통계를 활성화하기위한 여러 웹 자습서를 시도했지만 (Google haproxy 통계와 상위 10 개의 링크를 사용해보십시오) 이전 HAProxy 버전에 해당한다고 생각합니다. Ubuntu 16.04 LTS에서 1.7을 실행 중입니다.

다음은 내 /etc/haproxy/haproxy.cfg 파일입니다 (통계 활성화에 대한 Datadog의 지침 포함).

listen …. 블록을 제거하면 정상적으로 시작됩니다. 그것이있을 때 다음과 같은 오류가 발생합니다 :

sudo service haproxy stop
sudo service haproxy start
Job for haproxy.service failed because the control process exited with error code. See "systemctl status haproxy.service" and "journalctl -xe" for details.

journalctl 및 systemctl 출력 모두 “서비스가 너무 빨리 시작되었습니다 오류

haproxy.service - HAProxy Load Balancer
Loaded: loaded (/lib/systemd/system/haproxy.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Sun 2016-07-31 11:24:06 BST; 1min 19s ago
Docs: man:haproxy(1)
    file:/usr/share/doc/haproxy/configuration.txt.gz
Process: 1969 ExecReload=/bin/kill -USR2 $MAINPID (code=exited, status=0/SUCCESS)
Process: 2388 ExecReload=/usr/sbin/haproxy -c -f ${CONFIG} (code=exited, status=1/FAILURE)
Process: 2973 ExecStart=/usr/sbin/haproxy-systemd-wrapper -f ${CONFIG} -p /run/haproxy.pid $EXTRAOPTS (code=exited, status=0/SUCCESS)
Process: 3511 ExecStartPre=/usr/sbin/haproxy -f ${CONFIG} -c -q (code=exited, status=1/FAILURE)
Main PID: 2973 (code=exited, status=0/SUCCESS)

Jul 31 11:24:06 loadbalancervm-VirtualBox systemd[1]: haproxy.service: Control process exited, code=exited status=1
Jul 31 11:24:06 loadbalancervm-VirtualBox systemd[1]: Failed to start HAProxy Load Balancer.
Jul 31 11:24:06 loadbalancervm-VirtualBox systemd[1]: haproxy.service: Unit entered failed state.
Jul 31 11:24:06 loadbalancervm-VirtualBox systemd[1]: haproxy.service: Failed with result 'exit-code'.
Jul 31 11:24:06 loadbalancervm-VirtualBox systemd[1]: haproxy.service: Service hold-off time over, scheduling restart.
Jul 31 11:24:06 loadbalancervm-VirtualBox systemd[1]: Stopped HAProxy Load Balancer.
Jul 31 11:24:06 loadbalancervm-VirtualBox systemd[1]: haproxy.service: Start request repeated too quickly.
Jul 31 11:24:06 loadbalancervm-VirtualBox systemd[1]: Failed to start HAProxy Load Balancer.

haproxy.cfg 파일

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    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

frontend LOAD_BALANCER_TIER
    bind *:80
    default_backend WEB_SERVER_TIER

backend WEB_SERVER_TIER
    balance roundrobin
    mode http
    server WebServer1 192.168.1.9:80 check
    server WebServer2 192.168.1.11:80 check

listen stats :9000
    mode http
    stats enable
    stats hide-version
    stats realm HAproxy-Statistics
    stats uri /haproxy_stats
    stats auth admin:password

들여 쓰기 된 모든 줄은 공백이 아닌 탭을 사용합니다. 항목 사이에 공백이 있습니다.

어떤 아이디어?



답변

이전 버전에 대해서는 맞습니다. 프록시 ( frontend또는 listen) 선언이 시작 되는 라인의 포트에 바인딩하는 것은 HAProxy 1.5에서 제거되었으므로 유효하지 않습니다.

이것은 올바른 형식입니다.

listen stats
    bind :9000

frontend선언 에서 이미이 작업을 수행하고 있습니다 . A listen는 본질적으로 결합 된 프론트 엔드와 백엔드입니다.