Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

Install Galera Load Balancer on This Running MariaDB Galera Cluster

In this activity, you are a DBA working for a large financial company and have been tasked with installing the Galera Load Balancer on a proof of concept MariaDB Galera Cluster.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Sep 18, 2025
Duration
1h 0m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Set the root Database User's Password and Create a Database User Account
    1. Run the mysql_secure_installation script using the provided lab credentials:

      sudo mysql_secure_installation
      
    2. Configure the following settings:

      • Enter current password for root (enter for none): Enter
      • Switch to unix_socket authentication: y
      • Change the root password: y
      • New password: Any new password
      • Remove anonymous users? y
      • Disallow root login remotely? y
      • Remove test database and access to it? y
      • Reload privilege tables now? y
    3. Connect to the database as the root user and create a user account, using the newly created root password:

      mysql -u root -p
      
      
    4. Create a remote user, replacing "mypasswd" with a password of your choice:

      create user remote identified by 'mypasswd';
      
    5. Grant remote usage on all objects and allow user to log in from any host:

      grant usage on *.* to 'remote'@'%' identified by 'mypasswd';
      
    6. Enter quit to quit the program.

  2. Challenge

    Install the Prerequisite Packages and Build the Binaries
    1. Install the packages for building Galera Load Balancer, using the password provided for node0 on the lab page:

      sudo yum -y install git autoconf automake libtool gcc-c++ nmap-ncat
      
    2. Clone the GitHub repository:

      git clone https://github.com/codership/glb
      
    3. Move into the glb repository:

      cd glb/
      
    4. Run the Bootstrap script:

      ./bootstrap.sh
      
    5. Run the configure script:

      ./configure
      
    6. Create the binaries:

      make
      
    7. Install the binaries:

      sudo make install
      
  3. Challenge

    Start Galera Load Balancer
    1. Start the GLB manually on the command line:

      glbd -v -c 127.0.0.1:4444 10.0.1.100:13306 10.0.1.100:3306:1
      
    2. Open a second terminal window and log in to node1 using the provided lab credentials:

      ssh cloud_user@<PUBLIC_IP_ADDRESS>
      
    3. Connect to the cluster on node1 using the newly created remote user login credentials:

      mysql -u remote -h 10.0.1.100 -P 13306 -p
      
    4. Return to the node0 terminal and confirm the connection was made.

  4. Challenge

    Add Nodes and Query Stats
    1. Open up a new terminal window and log in to node0 using the provided lab credentials:

      ssh cloud_user@<PUBLIC_IP_ADDRESS>
      
    2. Add a node using port 4444:

      Note: This command must be run on the same node as the load balancer.

      echo "10.0.1.110:3306:1" | nc 127.0.0.1 4444
      
    3. Return to the first node0 terminal (the one running the load balancer) and confirm the second node is running.

    4. Query for statistics on the control port:

      echo "getstat"  | nc 127.0.0.1 4444
      
    5. Close the first node0 terminal window to stop the service.

  5. Challenge

    Configure and Start Galera Load Balancer as a Daemon
    1. On node0, move into the files directory of the cloned GitHub repository:

      cd glb/files
      
    2. Copy the Galera Load Balancer shell script file and log in using provided lab credentials:

      sudo cp glbd.sh /etc/init.d/glb
      
    3. Copy the configuration file to /etc/sysconfig/glbd:

      sudo cp glbd.cfg /etc/sysconfig/glbd
      
    4. Edit the configuration file:

      sudo vim /etc/sysconfig/glbd
      
    5. Uncomment and edit the following file parameters:

      • Set the listen address: LISTEN_ADDR="13306"
      • Change the control address: CONTROL_ADDR="127.0.0.1:4444"
      • Set both nodes as default targets: DEFAULT_TARGETS="10.0.1.100:3306:1 10.0.1.110:3306:1"
    6. Hit :wq! to save and exit the file.

    7. Start the service and check its status:

      sudo service glb start
      sudo service glb status
      
    8. Query for load balancer statistics:

      sudo service glb getstats
      
    9. Remove nodes:

      sudo service glb remove 10.0.1.100:3306
      
    10. Add nodes:

      sudo service glb add 10.0.1.100:3306:1
      
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight