Gebruikershulpmiddelen

Site-hulpmiddelen


installatie_handleidingen:mikrotik:ha-proxy

Dit is een oude revisie van het document!


HA-Proxy on RouterOS7

prerequisites

network connections

There are several ways to connect the HA-Proxy container to the network, here we chose to give it its own IP.
follow the instructions to create a virtual network interface with IP and connection to the desired VLAN.

Persistent volumes location

For the persistent volume of the container we create a directory

/file 
add type=directory name=/usb1/persistent-volumes/haproxy

configuration file

Start by creating the config file on your workstation, vi haproxy.cfg, add the following content for a test to the website at 10.100.10.103

global
    daemon
    maxconn 256

defaults
    mode http
    timeout connect 5s
    timeout client  50s
    timeout server  50s

frontend http_in
    bind *:80
    default_backend web_servers

backend web_servers
    balance roundrobin
    server srv1 10.100.10.103:80 check

upload this config file to the preveously crated location.

scp haproxy.cfg styx:/usb1/persistent-volumes/haproxy

set container mount

Now set the volume with the config file as a persistent volume mount in the container:

/container/mounts
add container=haproxy dst=/usr/local/etc/haproxy src=/usb1/persistent-volumes/haproxy/conf-dir

deploy the container

/container/add remote-image=haproxy:latest interface=veth-haproxy root-dir=usb1/persistent-volumes/haproxy/ root-dir hostname=haproxy /container/start haproxy

</code>

installatie_handleidingen/mikrotik/ha-proxy.1758456346.txt.gz · Laatst gewijzigd: 2025/09/21 14:05 door abel