HAProxy overview

Learn about the NFS HAProxy feature in IBM Storage Ceph.

HAProxy (High Availability Proxy) is a proxy server that listens on a dedicated IP, also known as a virtual IP. The proxy server works on TCP/HTTP. The proxy server receives the incoming requests and forwards the same to the configured backend servers. Forwarding the requests to the backend server is based on the load balancing algorithm that is specified in the configuration file and the current load of the backend server. The proxy server checks the health of backend servers, and if any of the backend servers is down, it stops forwarding incoming requests to that server.

When HAProxy is configured, high availability is achieved by using Keepalived. If the proxy server fails, Keepalived automatically moves and restarts HAProxy on another node, helping ensure continuous service availability.

The following are the key features of HAProxy:
High availability and failover
HAProxy helps maintain service continuity by monitoring the health of backend servers. If a server fails, HAProxy automatically reroutes traffic to healthy servers. Configuring Virtual IPs (VIPs) and heartbeat mechanisms enables seamless failover in high availability (HA) environments, ensuring minimal disruption and continuous service availability.
Virtual IPs (VIPs)
In an HA setup, HAProxy can use a Virtual IP to provide a single, consistent access point for clients. The VIP dynamically switches between active and standby nodes if there is failure, allowing automatic failover without requiring changes on the client side.
Access management and security

HAProxy enhances security by restricting access based on IP addresses, authentication mechanisms, and rate limiting. It can filter traffic by using ACLs (Access Control Lists) and block malicious requests.

By efficiently balancing traffic, managing failover, and securing access, HAProxy helps ensure a highly available and resilient infrastructure for modern applications.

Implementing HA for NFS service

You can use HAProxy along with CephFS and NFS services to improve availability and failover handling for distributed storage and file-sharing environments.

The following are some of the use cases when you can use HAProxy with Cepheus or NFS:

High availability for Ceph or NFS exports
If you have multiple Ceph or NFS servers, HAProxy can ensure that clients always connect to an available server, preventing disruptions.
Failover for storage services
If a Ceph or NFS server goes down, HAProxy can detect the failure and reroute traffic to a healthy server automatically.

In a Ceph cluster, to define an HA NFS service, use the nfs cluster create command and mention 1 in the PLACEMENT parameter along with hosts like host1 host2.. <hostn>. By mentioning 1 in the PLACEMENT, only 1 active NFS Ganesha server is created.

If the node where NFS is running goes down, the next host from the PLACEMENT configuration is used to start NFS.

HAProxy works with NFS on CephFS and RGW.

Important: IBM Storage Ceph does not support load balancing.