Configure the load balancer

This section describes how to configure your MySQL or MariaDB database for the HA deployment.

Set up load balancer

Configuring the load balancer may vary depending on the load balancer in question. Set up and configure your load balancer as instructed in the documentation of your load balancer.

You must situate the load balancer between the two nodes.

Example configuration

This example uses Balance by Inlab. For more details or to get Balance, see the Inlab website.

Note   On a production environment, it is recommended to use commercial load balancers.

The load balancer with the IP address listens on port 3306 and redirects to and The load balancer also does this for ports 80 and 443 for the Apache servers in the deployment. This infrastructure is set in the Balance load balancer as follows:

./balance 3306 %
./balance 80 %
./balance 443 %

Configure Joomla! with the load balancer

  1. After you have set up the load balancer, log in to the Joomla! Administrator Interface (JAI).
  2. Click System > Global Configuration > Server.
  3. Under Database settings, change the database host to point to the load balancer IP address on both nodes.

Fine-tune database settings

You can use advanced settings to fine-tune the database and its performance:

  • To automatically set increment IDs in the database and synchronize the IDs between the two nodes, check the settings for auto_increment_increment and auto_increment_offset.
  • To avoid timeout issues, check the master-connect-retry setting.
  • To avoid filling disk space with database replication logs, adjust the expire_log_days and max_binlog_size as needed.

It is recommended to keep an eye on the machine KPIs (disk space, RAM, CPU, network).

For more details on the database settings, see MySQL documentation or MariaDB documentation.

Related Links