HAProxy: einfache Konfiguration

// HAProxy Installation
apt-get install -y haproxy

// init Script Unterstützung
vi /etc/default/haproxy

# Set ENABLED to 1 if you want the init script to start haproxy.
ENABLED=1

// Konfiguration
cp /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.backup
vi /etc/haproxy/haproxy.cfg

frontend http-in
bind *:80
default_backend servers

backend servers
balance roundrobin
mode http
server app01 192.168.10.3:80 check
server app02 192.168.10.4:80 check

// Start
service haproxy restart
service haproxy status

// Anfragen an Loadbalancer mit der IP (192.168.10.2) senden
curl 192.168.10.2

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.