Ultimate Guide: Deploy Percona XtraDB Cluster 8.0 on Rocky Linux with Galera
Setting up Percona XtraDB Cluster 8.0 on Rocky Linux is one of the most reliable ways to achieve high availability and data consistency in MySQL-based environments. In this tutorial, we’ll walk through the full installation and configuration of a 3-node Galera cluster, with two database nodes and one Galera Arbitrator (garbd) for quorum resiliency across data centers.
Why Use Percona XtraDB Cluster?
Percona XtraDB Cluster (PXC) is a high-availability solution for MySQL based on Galera. It provides:
- Synchronous replication
- Automatic node failover
- Multi-master architecture
- Strong consistency
When combined with Galera Arbitrator, the system can survive the failure of an entire data center while maintaining write availability.
System Requirements
- Rocky Linux 9 on all nodes
- Network connectivity between nodes
- Firewalld ports open:
3306
(MySQL)4444
(SST)4567
(Galera replication)4568
(IST)
How to Install Percona XtraDB Cluster 8.0 on Rocky Linux
Step 1: Prepare the system
Disable default MySQL module and install the Percona repository:
dnf module disable mysql -y
yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm -y
percona-release setup pxc-80
Step 2: Install Percona on both DB nodes
yum install percona-xtradb-cluster -y
Start the MySQL service and retrieve the temporary root password:
service mysql start
grep 'temporary password' /var/log/mysqld.log
Log in and set a secure root password:
mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'YourStrongPassword!';
Stop the service to configure the cluster:
service mysql stop
Galera Configuration for Percona XtraDB Cluster 8.0
Node 1 (Bootstrap)
[mysqld]
wsrep_provider=/usr/lib64/galera4/libgalera_smm.so
wsrep_cluster_address=gcomm://
binlog_format=ROW
wsrep_slave_threads=8
wsrep_log_conflicts
innodb_autoinc_lock_mode=2
wsrep_node_address=NODE1_IP
wsrep_cluster_name=pxc-cluster
wsrep_node_name=pxc-node-1
pxc_strict_mode=ENFORCING
wsrep_sst_method=xtrabackup-v2
pxc-encrypt-cluster-traffic=OFF
Node 2
[mysqld]
wsrep_provider=/usr/lib64/galera4/libgalera_smm.so
wsrep_cluster_address=gcomm://NODE1_IP,NODE2_IP,ARBITRATOR_IP
binlog_format=ROW
wsrep_slave_threads=8
wsrep_log_conflicts
innodb_autoinc_lock_mode=2
wsrep_node_address=NODE2_IP
wsrep_cluster_name=pxc-cluster
wsrep_node_name=pxc-node-2
pxc_strict_mode=ENFORCING
wsrep_sst_method=xtrabackup-v2
pxc-encrypt-cluster-traffic=OFF
Replace NODE1_IP
, NODE2_IP
, and ARBITRATOR_IP
with the actual internal IPs of your servers.
Step 4: Bootstrap the Cluster
On Node 1:
systemctl start mysql@bootstrap.service
On Node 2:
systemctl start mysql
Step 5: Create SST User (optional)
On Node 1, log in and run:
CREATE USER 'sstuser'@'%' IDENTIFIED BY 'YourSecureSSTPassword!';
GRANT RELOAD, LOCK TABLES, PROCESS, REPLICATION CLIENT ON *.* TO 'sstuser'@'%';
FLUSH PRIVILEGES;
Update wsrep_sst_auth=sstuser:YourSecureSSTPassword!
in both nodes’ config if not set.
Step 6: Open Firewall Ports
firewall-cmd --permanent --add-port=3306/tcp
firewall-cmd --permanent --add-port=4444/tcp
firewall-cmd --permanent --add-port=4567/tcp
firewall-cmd --permanent --add-port=4567/udp
firewall-cmd --permanent --add-port=4568/tcp
firewall-cmd --reload
Step 7: Add Galera Arbitrator (GARB)
Install garbd on a third server:
yum install percona-xtradb-cluster-garbd -y
Configure /etc/sysconfig/garb
:
GALERA_NODES="NODE1_IP,NODE2_IP"
GALERA_GROUP="pxc-cluster"
Start the arbitrator:
systemctl start garb
Step 8: Validate Cluster Health
From either MySQL node:
SHOW STATUS LIKE 'wsrep_cluster_size';
Expected output:
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| wsrep_cluster_size | 3 |
+--------------------+-------+
Optional: Add the Cluster Node to Zabbix for Monitoring
Once your Percona XtraDB Cluster 8.0 on Rocky Linux is fully deployed, it’s highly recommended to integrate each node into your monitoring stack. A great option is Zabbix, which allows you to track metrics such as system load, disk usage, and MySQL service health.
You can automatically register the virtual machines in Zabbix using dynamic configuration techniques. Follow this guide to streamline the process:
👉 How to Auto-Register VMs in Zabbix 7
Once registered, you’ll be ready to move forward with a dedicated setup for monitoring Percona XtraDB Cluster and MySQL-specific metrics — which we’ll cover in an upcoming article.
Conclusion
By combining the power of Percona XtraDB Cluster 8.0, Galera, and Rocky Linux, you’re building a highly available, production-grade MySQL environment that’s ready for real-world distributed deployments.