To set up a simple MariaDB load balancing environment with HAProxy, start by installing MariaDB on your server nodes and securing them with the mysql_secure_installation script. Create a dedicated health check user on each database node, such as haproxy_check, to allow the proxy to monitor server status without requiring a password. Next, install HAProxy on a separate gateway or application server and configure its /etc/haproxy/haproxy.cfg file by defining a listen block for MySQL. Within this block, set the mode to tcp, bind it to port 3306, and use the option mysql-check with the created user to verify node availability. List your database backends with the check parameter to enable automatic failover, ensuring that if one node fails, HAProxy transparently routes traffic to the healthy remaining nodes. Finally, ensure your system's firewall and SELinux settings allow traffic on the database ports (typically 3306) and restart the HAProxy service to begin balancing connections across your MariaDB infrastructure.