Installation HAProxy für VMware vRealize Operations

Ein kleiner Beitrag, wie HAPoxy für VMware vRealize Operations installiert.

Grundsätzlich findest du alles bei VMware unter diesem Link

https://docs.vmware.com/en/vRealize-Operations-Manager/8.1/vRealize-Operations-Manager-Load-Balancing.pdf

Zum aktuellen Zeitpunkt ist jedoch nur die Version 8.1 verfügbar. Hier solltest du einfacher die Files via Copy Paste nutzen können.

Installation von HAProxy:

apt-get update
apt-get upgrade
apt-get install haproxy -y

Nun überprüfen, ob HAProxy installiert wurde und bereits läuft:

service haproxy status

Statische IP-Adresse vergeben.

vi /etc/network/interfaces
# The primary network interface
allow-hotplug ens192
iface ens192 inet static
  address 172.16.1.xxx/27
  gateway 172.16.1.xxx

Syslog aktivieren, damit das OS via UDP Syslogs empfangen kann. Dazu bei den folgenden beiden Optionen das # entfernen.

vi /etc/rsyslog.conf
# provides UDP syslog reception
module(load="imudp")
input(type="imudp" port="514")

Nun wird definiert, wohin die Dateien entsprechend geschrieben werden, sollte Syslog Meldungen erhalten.

vi /etc/rsyslog.d/haproxy.conf
if ($programname == 'haproxy') then -/var/log/haproxy.log

Die Empfängerdatei muss natürlich noch eingerichtet und berechtigt werden.

touch /var/log/haproxy.log
chmod 755 /var/log/haproxy.log
vi /etc/haproxy/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 expose-fd list
        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/
        # An alternative list with additional directives can be obtained from
        #  https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy
        ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!MD5:!DSS
        ssl-default-bind-options no-sslv3
        ssl-server-verify none

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

#listener settings for stats webpage
listen stats
        bind :9090
        balance
        mode http
        stats enable
        stats auth admin:admin
        stats uri /
        stats realm Haproxy\ Statistics

#automatic redirect for http to https connections
frontend vrops_unsecured_redirect
        bind *:80
        redirect location https://#FQDN#

#front settings in this case we bind to all addresses on system or specify an interface
frontend vrops_frontend_secure
        bind #HAPROXYIP#:443
        mode tcp
        option tcplog
        default_backend vrops_backend_secure

#backend configuration of receiving servers containing tcp-checks health checks and hashing
#needed for a proper configuration and page sessions
#adjust the server parameters to your environment
backend vrops_backend_secure
        mode tcp
        option tcplog
        balance source
        hash-type consistent
        option tcp-check
        tcp-check connect port 443 ssl
        tcp-check send GET\ /suite-api/api/deployment/node/status?services=api&services=adminui&services=ui\ HTTP/1.0\r\n\r\n
        tcp-check expect rstring ONLINE

        server #FQDN NODE1# #IP NODE1#:443 check inter 60s maxconn 140 fall 6 rise 6
        server #FQDN NODE2# #IP NODE2#:443 check inter 60s maxconn 140 fall 6 rise 6
        server #FQDN NODE3# #IP NODE3#:443 check inter 60s maxconn 140 fall 6 rise 6
AbschnittBeschreibung
ssl-server-verify noneEs findet keine ssl-Überprüfung statt.
#listener settings for stats webpageHierunter wird der Statistikpart gebunden, damit man später ein schönes GUI zum prüfen des HAProxy hat. Darunter sind auch Username und Passwort vermerkt.

Danach nicht vergessen, den Service HAProxy neu zu starten und den Status zu prüfen.

service haproxy restart
service haproxy status

Leave a Reply

Your email address will not be published. Required fields are marked *