Thursday, September 22, 2022

How To Enable HAProxy Stats On Rocky Linux 8.5

 in This Tutorial you will Learn "How To Enable HAProxy Stats On Rocky Linux 8.5"

HAProxy Stats is a useful application that provides useful information about total connection, data transfer, server state and more.

HAProxy is a free, very fast and reliable reverse-proxy offering high availability, load balancing, and proxying for TCP and HTTP-based applications.
_________________________________________________________________________________________
Server - Os:  Rocky Linux 8.5  64Bit      |    IP -192.168.1.20        |     Hostname - www.primaryhost.com
_________________________________________________________________________________________
cat /etc/system-release ; sestatus ; dnf groupinstall "Development Tools" -y
dnf -y install haproxy
gedit /etc/haproxy/haproxy.cfg &>/dev/null
frontend http-in
    # listen 80 port
    bind *:80
    # set default backend
    default_backend    backend_servers
    # send X-Forwarded-For header
    option             forwardfor

backend backend_servers
    # balance with roundrobin
    balance            roundrobin
    # define backend servers
    server             node01 192.168.1.80:80 check
    server             node02 192.168.1.70:80 check
    # enable statistics reports
    stats enable
    # auth info for statistics site
    stats auth admin:adminpassword
    # hide version of HAProxy
    stats hide-version
    # display HAProxy hostname
    stats show-node
    # refresh time
    stats refresh 60s
    # statistics reports URI
    stats uri /haproxy?stats
systemctl enable --now haproxy ; systemctl daemon-reload ; systemctl restart haproxy
http://127.0.0.1/haproxy?stats
________________________________________________________________________________________

No comments:

Post a Comment