Setting up Galera Arbitrator

Galera Arbitrator <http://galeracluster.com/documentation-webpages/arbitrator.html> is a member of the Percona XtraDB Cluster which is used for voting in case you have a small number of servers (usually two) and don’t want to add any more resources. For example arbitrator can be set up on existing application server or on load balancer.

Galera Arbitrator is a member of the cluster which participates in the voting, but not in the actual replication (although it receives the same data as other nodes).

This document will show how to add Galera Arbitrator node to a already set up cluster.

Note

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

Installation

Galera Arbitrator can be installed from Percona’s repository by running:

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

on Debian/Ubuntu distributions, or:

[root@centos ~]# yum install Percona-XtraDB-Cluster-garbd-2

on CentOS/RHEL distributions.

Configuration

To configure Galera Arbitrator on Ubuntu/Debian you need to edit the /etc/default/garbd file. On CentOS/RHEL configuration can be found in /etc/sysconfig/garb file.

Configuration file should look like this after installation:

# Copyright (C) 2012 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=""

To set it up you’ll need to add the information about the cluster you’ve set up. This example is using cluster information from the Installing Percona XtraDB Cluster on Ubuntu.

# Copyright (C) 2012 Codership Oy
# 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=""

# Log file for garbd. Optional, by default logs to syslog
# Deprecated for CentOS7, use journalctl to query the log for garbd
# LOG_FILE=""

Note

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

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

  • On Debian or Ubuntu:
root@server:~# service garbd start
[ ok ] Starting /usr/bin/garbd: :.
  • On Red Hat Enterprise Linux or CentOS:
root@server:~# service garb start
[ ok ] Starting /usr/bin/garbd: :.

You can additionally check the arbitrator status by running:

  • On Debian or Ubuntu:
root@server:~# service garbd status
[ ok ] garb is running.
  • On Red Hat Enterprise Linux or CentOS:
root@server:~# service garb status
[ ok ] garb is running.