HAProxy – a brief overview

The built-in pfSense load balancer may be perfectly adequate for many use cases, especially if you are setting up a load balancer for a home or small office/home office network. If you require a more enterprise-level solution for load balancing, however, you need not fret: High Availability Proxy (HAProxy), an open source program (covered by the GPL) which is advertised as a fast and reliable solution offering high availability, [and] load balancing is available as a third-party package. 

It is not within the scope of this chapter to provide a detailed discussion of HAProxy- it will be covered in more depth in Chapter 12, Extending pfSense with Packages. Be aware that it is an option, however, and that installation is relatively easy. Just navigate to System | Package Manager, click on the Available Packages tab, scroll down to HAProxy on the list, click the Install button, and on the next page, click on the Confirm button. Once installation is complete, there will be a new entry on the Services menu called HAProxy. If you navigate to it, you can begin configuration.

There are several tabs on the HAProxy configuration page, but I will confine my overview to the first three tabs. The Settings tab has some global settings that define HAProxy's behavior. The first setting is the Enable HAProxy checkbox; upon installation, HAProxy is disabled by default and we must enable it if we want it to run. You may set Maximum connections and also enable the Carp monitor on this page. HAProxy can use CARP to update its settings within a CARP firewall failover group. The HAProxy Sync checkbox is at the very bottom of the page. You can also use this page to do such things as send log data to a remote syslog server, point HAProxy to a DNS server, and provide for email notifications of any change in the state of HAProxy.

On the Frontend tab, we see a table with all configured frontends. Click on the Add button to add a new frontend. This is where you specify the listen address and port for the virtual server (usually the network's public IP address). You can also configure such things as the Type of server (either http/https, ssl/https, or tcp), access control lists (ACLs), and logging options.

On the Backend tab, where we see a list of configured backends, we can click on the Add button to add a backend. The backend is where you specify the IP addresses of servers in the server pool. You can also specify the load balancing algorithm. Many of the algorithms discussed earlier in this chapter (for example round-robin, weighted round-robin, least connections, and so on) are available. You can also specify timeout settings, options for checking to see whether a server is up, email options, and many more options.

There is much more to HAProxy than this brief overview covers, but do not let that discourage you from installing HAProxy if it sounds like something that will better suit your load balancing requirements.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset