Skip to content
logo
Percona XtraDB Cluster
Set up Galera arbitrator
Initializing search
    percona/pxc-docs
    percona/pxc-docs
    • Home
      • About Percona XtraDB Cluster
      • Percona XtraDB Cluster limitations
      • Understand version numbers
      • Quick start guide for Percona XtraDB Cluster
      • Install Percona XtraDB Cluster
      • Configure nodes for write-set replication
      • Bootstrap the first node
      • Add nodes to cluster
      • Verify replication
      • High availability
      • PXC strict mode
      • Online schema upgrade
      • Non-Blocking Operations (NBO) method for Online Scheme Upgrades (OSU)
      • Security basics
      • Secure the network
      • Encrypt PXC traffic
      • Enable AppArmor
      • Enable SELinux
      • State snapshot transfer
      • Percona XtraBackup SST configuration
      • Restart the cluster nodes
      • Cluster failover
      • Monitor the cluster
      • Certification in Percona XtraDB Cluster
      • Percona XtraDB Cluster threading model
      • Understand GCache and Record-Set cache
      • GCache encryption and Write-Set cache encryption
      • Perfomance Schema instrumentation
      • Data at Rest Encryption
      • Upgrade Percona XtraDB Cluster
      • Crash recovery
      • Configure Percona XtraDB Cluster on CentOS
      • Configure Percona XtraDB Cluster on Ubuntu
      • Set up Galera arbitrator
        • Installation
        • Start garbd and configuration
      • How to set up a three-node cluster on a single box
      • How to set up a three-node cluster in EC2 environment
      • Load balancing with HAProxy
      • Load balancing with ProxySQL
      • ProxySQL admin utilities
      • Setting up a testing environment with ProxySQL
      • Release notes index
      • Percona XtraDB Cluster 8.0.31-23 (2023-03-14)
      • Percona XtraDB Cluster 8.0.30-22.md (2022-12-28)
      • Percona XtraDB Cluster 8.0.29-21 (2022-09-12)
      • Percona XtraDB Cluster 8.0.28-19.1 (2022-07-19)
      • Percona XtraDB Cluster 8.0.27-18.1
      • Percona XtraDB Cluster 8.0.26-16.1
      • Percona XtraDB Cluster 8.0.25-15.1
      • Percona XtraDB Cluster 8.0.23-14.1
      • Percona XtraDB Cluster 8.0.22-13.1
      • Percona XtraDB Cluster 8.0.21-12.1
      • Percona XtraDB Cluster 8.0.20-11
      • Percona XtraDB Cluster 8.0.20-11.3
      • Percona XtraDB Cluster 8.0.20-11.2
      • Percona XtraDB Cluster 8.0.19-10
      • Percona XtraDB Cluster 8.0.18-9.3
      • Index of wsrep status variables
      • Index of wsrep system variables
      • Index of wsrep_provider options
      • Index of files created by PXC
      • Frequently asked questions
      • Glossary
      • Copyright and licensing information
      • Trademark policy

    • Installation
    • Start garbd and configuration

    Set up Galera arbitrator¶

    The size of a cluster increases when a node joins the cluster and decreases when a node leaves. A cluster reacts to replication problems with inconsistency voting. The size of the cluster determines the required votes to achieve a quorum. If a node no longer responds and is disconnected from the cluster the remaining nodes vote. The majority of the nodes that vote are considered to be in the cluster.

    The arbitrator is important if you have an even number of nodes remaining in the cluster. The arbitrator keeps the number of nodes as an odd number, which avoids the split-brain situation.

    A Galera Arbitrator is a lightweight member of a Percona XtraDB Cluster. This member can vote but does not do any replication and is not included in flow control calculations. The Galera Arbitrator is a separate daemon called garbd. You can start this daemon separately from the cluster and run this daemon either as a service or from the shell. You cannot configure this daemon using the my.cnf file.

    Note

    For more information on how to set up a cluster you can read in the Configuring Percona XtraDB Cluster on Ubuntu or Configuring Percona XtraDB Cluster on CentOS manuals.

    Installation¶

    Galera Arbitrator does not need a dedicated server and can be installed on a machine running other applications. The server must have good network connectivity.

    Galera Arbitrator can be installed from Percona’s repository on Debian/Ubuntu distributions with the following command:

    root@ubuntu:~# apt install percona-xtradb-cluster-garbd
    

    Galera Arbitrator can be installed from Percona’s repository on RedHat or derivative distributions with the following command:

    [root@centos ~]# yum install percona-xtradb-cluster-garbd
    

    Start garbd and configuration¶

    Note

    On Percona XtraDB Cluster 8.0, SSL is enabled by default. To run the Galera Arbitrator, you must copy the SSL certificates and configure garbd to use the certificates.

    It is necessary to specify the cipher. In this example, it is AES128-SHA256. If you do not specify the cipher, an error occurs with a “Terminate called after throwing an instance of ‘gnu::NotSet’” message.

    For more information, see socket.ssl_cipher

    When starting from the shell, you can set the parameters from the command line or edit the configuration file. This is an example of starting from the command line:

    $ garbd --group=my_ubuntu_cluster \
    --address="gcomm://192.168.70.61:4567, 192.168.70.62:4567, 192.168.70.63:4567" \
    --option="socket.ssl=YES; socket.ssl_key=/etc/ssl/mysql/server-key.pem; \
    socket.ssl_cert=/etc/ssl/mysql/server-cert.pem; \
    socket.ssl_ca=/etc/ssl/mysql/ca.pem; \
    socket.ssl_cipher=AES128-SHA256"
    

    To avoid entering the options each time you start garbd, edit the options in the configuration file. To configure Galera Arbitrator on Ubuntu/Debian, edit the /etc/default/garb file. On RedHat or derivative distributions, the configuration can be found in /etc/sysconfig/garb file.

    The configuration file should look like this after the installation and before you have added your parameters:

    # Copyright (C) 2013-2015 Codership Oy
    # This config file is to be sourced by garb service script.
    
    # REMOVE THIS AFTER CONFIGURATION
    
    # A comma-separated list of node addresses (address[:port]) in the cluster
    # GALERA_NODES=""
    
    # Galera cluster name, should be the same as on the rest of the nodes.
    # GALERA_GROUP=""
    
    # Optional Galera internal options string (e.g. SSL settings)
    # see http://galeracluster.com/documentation-webpages/galeraparameters.html
    # GALERA_OPTIONS=""
    
    # Log file for garbd. Optional, by default logs to syslog
    # Deprecated for CentOS7, use journalctl to query the log for garbd
    # LOG_FILE=""
    

    Add the parameter information about the cluster. For this document, we use the cluster information from Configuring Percona XtraDB Cluster on Ubuntu.

    Note

    Please note that you need to remove the # REMOVE THIS AFTER CONFIGURATION line before you can start the service.

    # This config file is to be sourced by garb service script.
    
    # A comma-separated list of node addresses (address[:port]) in the cluster
    GALERA_NODES="192.168.70.61:4567, 192.168.70.62:4567, 192.168.70.63:4567"
    
    # Galera cluster name, should be the same as on the rest of the nodes.
    GALERA_GROUP="my_ubuntu_cluster"
    
    # Optional Galera internal options string (e.g. SSL settings)
    # see http://galeracluster.com/documentation-webpages/galeraparameters.html
    # GALERA_OPTIONS="socket.ssl_cert=/etc/ssl/mysql/server-key.pem;socket./etc/ssl/mysql/server-key.pem"
    
    # Log file for garbd. Optional, by default logs to syslog
    # Deprecated for CentOS7, use journalctl to query the log for garbd
    # LOG_FILE="/var/log/garbd.log"
    

    You can now start the Galera Arbitrator daemon (garbd) by running:

    root@server:~# service garbd start
    
    Expected output
    [ ok ] Starting /usr/bin/garbd: :.
    

    Note

    On systems that run systemd as the default system and service manager, use systemctl instead of service to invoke the command. Currently, both are supported.

    root@server:~# systemctl start garb
    
    root@server:~# service garb start
    
    Expected output
    [ ok ] Starting /usr/bin/garbd: :.
    

    Additionally, you can check the arbitrator status by running:

    root@server:~# service garbd status
    
    Expected output
    [ ok ] garb is running.
    
    root@server:~# service garb status
    
    Expected output
    [ ok ] garb is running.
    

    Contact us

    For free technical help, visit the Percona Community Forum.

    To report bugs or submit feature requests, open a JIRA ticket.

    For paid support and managed or consulting services , contact Percona Sales.


    Last update: 2023-01-20
    Percona LLC and/or its affiliates, © 2023
    Made with Material for MkDocs

    Cookie consent

    We use cookies to recognize your repeated visits and preferences, as well as to measure the effectiveness of our documentation and whether users find what they're searching for. With your consent, you're helping us to make our documentation better.