Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Panel

mft:~# ifconfig -a
eth1       Link encap:Ethernet HWaddr 08:00:27:E3:61:8C
inet            inet addr:192.168.56.101 Bcast:0.0.0.0 Mask:255.255.255.0
inet6            inet6 addr: fe80::a00:27ff:fee3:618c/64 Scope:Link
UP            UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX            RX packets:6769 errors:0 dropped:0 overruns:0 frame:0
TX            TX packets:20079 errors:0 dropped:0 overruns:0 carrier:0
collisions           collisions:0 txqueuelen:1000
RX            RX bytes:1232486 (1.1 MiB) TX bytes:1609240 (1.5 MiB)

eth1:1     Link encap:Ethernet HWaddr 08:00:27:E3:61:8C
inet            inet addr:192.168.56.100 Bcast:0.0.0.0 Mask:255.255.255.0
UP            UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

...

  • The placeholder "<SERVERNAME>" must be the server name of the configuration. Since we are going to install this under 2 machines, replace with mft_1 or mft_2 or localhost.

  • The placeholder "<SERVERPORT>" is the port of the UDMG server, 18080 with the default installation guideline.

  • HAProxy Status API is configured on port 8081

  • Two ranges of ports are forwarded for the FTP (3000-3010) and SFTP (4000-4010) inbound connections to the backend UDMG servers. This can be tuned according to the desired MFT configuration.

Panel

#/etc/haproxy/haproxy.cfg

# --------------------------------------------------------------------------- #
# Global
# --------------------------------------------------------------------------- #
global
  log 127.0.0.1 local0 info


# --------------------------------------------------------------------------- #
# Defaults Timeouts
# --------------------------------------------------------------------------- #
defaults
  retries 3
  option redispatch
  timeout client 30s
  timeout connect 4s
  timeout server 30s


# --------------------------------------------------------------------------- #
# Stats
# --------------------------------------------------------------------------- #
listen stats
bind  bind *:8081
mode  mode http
log  log global
maxconn  maxconn 10
stats  stats enable
stats  stats hide-version
stats  stats refresh 30s
stats  stats show-node
stats  stats auth admin:password
stats  stats uri /status


# --------------------------------------------------------------------------- #
# FTP - mft Servers
# --------------------------------------------------------------------------- #
frontend ftp_service_front
bind  bind vip:4000-4010 transparent
mode  mode tcp
use use_backend ftp_service_backend


backend ftp_service_backend
mode  mode tcp
stick stick-table type ip size 10k expire 300s
stick  stick on src
server  server gw0 <SERVERNAME> check port <SERVERPORT>


# --------------------------------------------------------------------------- #
# SFTP - mft Servers
# --------------------------------------------------------------------------- #
frontend sftp_service_front
bind  bind vip:3000-3010 transparent
mode  mode tcp
use use_backend sftp_service_backend


backend sftp_service_backend
mode  mode tcp
stick stick-table type ip size 10k expire 300s
stick  stick on src
server  server gw0 <SERVERNAME> check port <SERVERPORT>


# --------------------------------------------------------------------------- #
# UDMG Server
# --------------------------------------------------------------------------- #
frontend gw_service_front
bind  bind vip:8080 transparent
mode  mode http
default default_backend gw_service_backend


backend gw_service_backend
mode  mode http
balance  balance roundrobin
cookie  cookie SRVNAME insert
server  server gw0 <SERVERNAME> check port <SERVERPORT> cookie S01 check


# --------------------------------------------------------------------------- #
# Nginx
# --------------------------------------------------------------------------- #
frontend nx_service_front
bind  bind vip:80 transparent
mode  mode http
default default_backend nx_service_backend

backend nx_service_backend
mode  mode http
balance  balance roundrobin
cookie  cookie SRVNAME insert
server  server gw0 <SERVERNAME> check port 80 cookie S01 check


# --------------------------------------------------------------------------- #
# END
# --------------------------------------------------------------------------- #
# EOF

...

Panel

upstream mft_proxy {
    ip_hash;
    server <SERVERNAME or SERVER IP>:5000;
    keepalive 10;
}

server {
listen <SERVERNAME or SERVER IP>::80 default_server;

location / {
        try_files $uri $uri/ /index.html;
root "/var/www/localhost/htdocs";
}

    location /service/ {
      proxy_pass      http://mft_proxy/;
    }

# You may need this to prevent return 404 recursion.
location = /404.html {
internal;
}
}

...

Panel

vrrp_instance VI_1 {
        # state MASTER #      # This setting must be comment for Backup Mode
        state BACKUP #    # This setting will be uncommented for the Backup Node
        interface eth1
        virtual_router_id 51
        priority 255
        advert_int 1
        authentication {
              auth_type PASS
              auth_pass 12345
        }
        virtual_ipaddress {
              192.168.56.100/24dev eth1 label eth1:1
        }
}

Checking the failover

In order to see whether the configuration was successful, stop one of the the mft server, and validate that the VIP interface is moving to the other host.

...