Docs / Databases / MariaDB Galera Cluster Configuration

MariaDB Galera Cluster Configuration

By Admin · Jan 22, 2026 · Updated Apr 23, 2026 · 5 views · 2 min read

MariaDB Galera Cluster Configuration is a common requirement for VPS administrators. This guide provides practical instructions that you can follow on Ubuntu 22.04/24.04 or Debian 12, though most steps apply to other distributions as well.

Prerequisites

  • A VPS running Ubuntu 22.04 or later (2GB+ RAM recommended)
  • The target database server installed and running
  • A database client tool for testing connections

Installation and Initial Setup

If you encounter issues during setup, check the system logs first. Most problems can be diagnosed by examining the output of journalctl or the application-specific log files in /var/log/.


-- Check current configuration
SHOW VARIABLES LIKE '%galera%';
SHOW STATUS LIKE '%galera%';

-- Optimize settings
SET GLOBAL galera_size = '256M';

The configuration above sets the recommended values for a VPS with 2-4GB of RAM. Adjust the memory-related settings proportionally if your server has different specifications.

Configuration Tuning

Regular maintenance is essential for keeping your mariadb installation running smoothly. Schedule periodic reviews of log files, disk usage, and security updates to prevent issues before they occur.


# Configuration file: /etc/mysql/mysql.conf.d/mysqld.cnf
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf

# Add these optimizations:
[mysqld]
innodb_buffer_pool_size = 1G
innodb_log_file_size = 256M
innodb_flush_log_at_trx_commit = 2
max_connections = 200

# Restart the service
sudo systemctl restart mysql

The output should show the service running without errors. If you see any warning messages, address them before proceeding to the next step.

Wrapping Up

Following this guide, your mariadb setup should be production-ready. Keep an eye on resource usage as your traffic grows and don't forget to test your backup and recovery procedures periodically.

Was this article helpful?