You are here

Galera Load Balancer

Table of Contents


Installing Galera Load Balancer

Before you start you should install the Galera Load Balancer package on the machines where the Galera Load Balancer should reside. If you are using the FromDual Repositories, this is quite easy:

apt update && apt install glb   # for Debian and Ubuntu
dnf install glb   # For Redhat based distributions

systemctl enable glb

vi /etc/default/glb   # On Debian based distributions
vi /etc/sysconfig/glbd   # On Redhat based distributions

The Galera Load Balancer configuration file is located under /etc/default/glb (on Debian based distributions) and under /etc/sysconfig/glbd (on Redhat based distributions). A useful configuration file to start with looks as follows:

LISTEN_ADDR="3306"
CONTROL_ADDR="10.139.158.117:8011"   # 127.0.0.1:8011 is currently NOT supported by Ops Center
CONTROL_FIFO="/run/glbd.fifo"
THREADS="4"
MAX_CONN="453"
DEFAULT_TARGETS="192.168.1.1:3306:1 192.168.1.2:3306:1 192.168.1.3:3306:1"
OTHER_OPTIONS="--round"

Machine and ssh key

Ideally you add a Machine in Ops Center where the Galera Load Balancer resides. If you omit this step you should copy over at least the ssh Public Key of the Web-Server user to the Machine the Galera Load Balancer resides. For a Debian based distribution this is done as follows:

sudo ssh-copy-id -i /var/www/.ssh/id_?sa.pub -p 22 root@10.139.158.117

Adding a new Galera Load Balancer

To add a new Load Balancer to the Ops Center click on the Load Balancer item in the menu on the left and then click the Add Load Balancer button:

Choose a unique and descriptive Name for the Load Balancer and choose the Type Galera Load Balancer:

The fields have the following meaning:

Field nameMeaning of field
NameUnique and descriptive name for the Load Balancer.
TypeType of Load Balancer.
RsrcGrp(Resource Group) is the team the Load Balancer belongs to and to which it is cleared to.
Admin UserO/S user Ops Center will use to connect to the machine.
Admin IPIP address (or hostname) Ops Center will use to connect to.
ssh PortPort which is used by Ops Center to connect to the machine (this is typically ssh port 22).
Socket or IP:PortSocket or IP/port combination the Load Balancers admin interface can be reached.
Configuration FileConfiguration file of the Galera Load Balancer. The Galera Load Balancer configuration file is typically located under /etc/default/glb on DEB based distributions and under /etc/sysconfig/glbd on RPM based distributions.
Balancing PolicyPolicy how your Galera Load Balancer should balance connections (Least connected, Round Robin, Random, Source Tracking (aka Source Sticky), Single Destination). For more details look here: Destination Selection Policies.

Then click to the Create button to create the Load Balancer in the Ops Center repository.

If you follow the Continue button you will end up in the configuration overview (Settings tab) of the Load Balancer. If you follow the link you will reach the Operations tab.

Operations tab

Next you should start your Galera Load Balancer if it is not started yet. This can be done in the Operations tab:

Note: Actually the synchronization of the Galera Load Balancer configuration information in the Ops Center (Settings tab) and the Galera Load Balancer configuration (/etc/default/glb or /etc/sysconfig/glbd) is not so smooth yet as it could be. Possibly you have to change the Galera Load Balancer configuration and stop it manually the first time until everything is working well...

Here you can stop (Stop Load Balancer), start (Start Load Balancer) and restart (Restart Load Balancer) the Galera Load Balancer and Persist configuration of your Galera Load Balancer you have changed in the Ops Center.

When you persist the configuration the old version is backed-up in the same directory.

By clicking on the + or - icon you can increase and decrease the weight of a back end node. By clicking on the Drain node or Undrain node icon on the very right you can drain or undrain a backend node. A weight of 0.000 has the same meaning an effect as draining a node. Undraining a node leads to a node weight of 1.000. So the old value is not remembered at the moment.

Checks tab

In the checks tab you can see if the Galera Load Balancer is up and running and get some simple monitoring statistics.

Settings tab

In the Settings tab you can see the actual configuration of your Galera Load Balancer. With the Edit Load Balancer button you can change some of those settings. With the Delete Load Balancer button you can remove the Load Balancer from Ops Center again.
Important: The Load Balancer is only delete in the Ops Center repository. Nothing is changes or deleted on the machine! You have to remove the Load Balancer manually from there afterwards...

Edit Load Balancer

Here you can change all the settings you have entered during adding your Load Balancer. There is one additional option: Balancing Policy.

If you have changed your Load Balancer configuration do not forget to persist the configuration and Restart the Load Balancer in the Operations tab...

Note: Actually it is NOT possible to add and delete nodes from the Galera Load Balancer. This must be done directly in the configuration file.