logo

How to create high available cluster for HAProxy and NGINX

About VRRP

The Virtual Router Redundancy Protocol (VRRP) is a computer networking protocol that provides automatic assignment of available Internet Protocol (IP) routers to participating hosts. This increases the availability and reliability of routing paths via automatic default gateway selections on an IP subnetwork.

The protocol achieves this by creation of virtual routers, which are an abstract representation of multiple routers, i.e. master and backup routers, acting as a group. The virtual router is assigned to act as a default gateway of participating hosts, instead of a physical router. If the physical router that is routing packets on behalf of the virtual router fails, another physical router is selected to automatically replace it. The physical router that is forwarding packets at any given time is called the master router.

VRRP provides information on the state of a router, not the routes processed and exchanged by that router. Each VRRP instance is limited, in scope, to a single subnet. It does not advertise IP routes beyond that subnet or affect the routing table in any way. VRRP can be used in Ethernet, MPLS and Token Ring networks with Internet Protocol Version 4 (IPv4), as well as IPv6.

Go to TOP

About HA cluster


Roxy-WI allows creating а HA cluster and enable VRRP for it via the web panel. Roxy-WI uses Keepalived application for creating VRRP and its own tools for managing HAProxy and Nginx services in cluster mode. Moreover, since v6.1.5 Roxy-WI can check whether services such as HAProxy, NGINX are already installed and running. If they are not, Roxy-WI’ll try to install them. Just tick the checkboxes with corresponding services names to do it. Keep in mind, that HAProxy service is enabled by default if no other service’s selected.

When you have created a HA cluster, the keepalived daemon can be used to monitor services or systems. In case of failover the standby router is enabled. It will work as it is shown in the image below:

Roxy-WI will keep synced the configs of the master server and those of the slave. When a config is an edited or new sections are added to it, the server is restarted.

Go to TOP

Add existing HA cluster

If you already have installed Keepalived service and want to manage them via Roxy-WI you can add your clusters.

To add your HA clusters open HA page. Press the "Create HA cluster" button.

Fill the fields with your parameters, press the "Next" button and check additional parameters.

Press "Save" to create HA cluster without reconfiguration your services.

Go to TOP

Create HA cluster

Roxy-WI can check whether services such as HAProxy, NGINX are already installed and running. If they are not, Roxy-WI’ll try to install them. Just tick the checkboxes with corresponding services names to do it.

To create a HA cluster open HA page. Press the "Create HA cluster" button.

Fill the fields with your parameters, press the "Next" button and check additional parameters.

Note: The VIP address as well as those of the servers must belong to the same network.

Press "Save" if you would like just save HA cluster configuration without applying on servers.

Press "Apply" if you would like install and configure HA cluster with checked services.

Go to TOP

Master-Slave relationships

After you have created the HA cluster Roxy-WI will use HAProxy, Nginx and Apache service as master and slave. If it has not occurred, go to the Admin area (or Servers if you use groups) -> Servers tab and select a master server:

When the two or more servers are combined, the config of the slave will be updated when you update it on the master.

Roxy-WI will also keep synchronized the uploaded SSL certificates, the black/white lists and maps.

Adding a virtual IP via Roxy-WI

The virtual IP is the single IP address that will be used as the point of access to the HA cluster. It is configured in the Keepalived configuration. When a user accesses a virtual IP, the traffic is directed to the appropriate server according to configure HAProxy policy. With Roxy-WI you can configure virtual IP via the web interface. To create the Virtual IP when creating the cluster set the "Add VIRT" checkbox and press Save or Apply. If all has passed successfully, the new server will be added to the cluster; in the list of the servers it will be marked as "VRRP IP for [Your_server_IP]

Go to TOP

Was this article helpful?

Yes, thanks!
Go back