Primary/Replica
Overview
Enterprise Server 10.4
Enterprise Server 10.5
Enterprise Server 10.6
Enterprise Server 11.4
MariaDB Replication
Highly available
Asynchronous or semi-synchronous replication
Automatic failover via MaxScale
Manual provisioning of new nodes from backup
Scales reads via MaxScale
Enterprise Server 10.3+, MaxScale 2.5+
This procedure describes the deployment of the Primary/Replica topology with MariaDB Enterprise Server and MariaDB MaxScale.
Primary/Replica topology provides read scalability and fault tolerance through asynchronous or semi-synchronous single-primary replication.
This procedure has 7 steps, which are executed in sequence.
MariaDB products can be deployed in many different topologies to suit specific use cases. The Primary/Replica topology can be deployed on its own, or integrated with MariaDB Enterprise Cluster.
This procedure represents basic product capability with 3 Enterprise Server nodes and 1 MaxScale node.
This page provides an overview of the topology, requirements, and deployment procedure.
Please read and understand this procedure before executing.
Procedure Steps
Install MariaDB Enterprise Server
Start and Configure MariaDB Enterprise Server on Primary Server
Start and Configure MariaDB Enterprise Server on Replica Servers
Test MariaDB Enterprise Server
Install MariaDB MaxScale
Start and Configure MariaDB MaxScale
Test MariaDB MaxScale
Components
The following components are deployed during this procedure:
MariaDB Enterprise Server
Modern SQL RDBMS with high availability, pluggable storage engines, hot online backups, and audit logging.
Database proxy that extends the availability, scalability, and security of MariaDB Enterprise Servers
MariaDB Enterprise Server Components
General purpose storage engine
ACID-compliant
Performance
MariaDB MaxScale Components
Listener
Listens for client connections to MaxScale, then passes them to the router service associated with the listener
MariaDB Monitor
Tracks changes in the state of MariaDB Enterprise Servers.
Read Connection Router
Routes connections from the listener to any available Enterprise Server node
Read/Write Split Router
Routes read operations from the listener to any available Enterprise Server node, and routes write operations from the listener to a specific server operating as the primary server
Server Module
Connection configuration in MaxScale to an Enterprise Server node
Topology

Primary/Replica topology provides read scalability and fault tolerance through asynchronous or semi-synchronous single-primary replication of MariaDB Enterprise Server 11.4
The Primary/Replica topology consists of:
1 or more MaxScale nodes
1 Enterprise Server node operating as the primary server
2 or more Enterprise Server nodes operating as replica servers.
The MaxScale nodes:
Monitor the health and availability of the Enterprise Server nodes
Route queries to Enterprise Server nodes using Read/Write Split (
readwritesplit
) and Read Connection (readconnroute
) routers.Promote replica servers in the event that the primary server fails.
The Enterprise Server node operating as the primary server:
Receives write queries from MaxScale, logging them to the Binary Log
Provides Binary Logs to replica servers for replication
The Enterprise Server nodes operating as replica servers:
Receive read queries from MaxScale
Replicate writes asynchronously or semi-synchronously from the primary server
Requirements
These requirements are for the Primary/Replica topology when deployed with MariaDB Enterprise Server 11.4 and MariaDB MaxScale 25.01.
Operating System
In alignment to the enterprise lifecycle, the Primary/Replica topology with MariaDB Enterprise Server 11.4 and MariaDB MaxScale 25.01 is provided for:
AlmaLinux 8 (x86_64, ARM64)
AlmaLinux 9 (x86_64, ARM64)
Debian 11 (x86_64, ARM64)
Debian 12 (x86_64, ARM64)
Microsoft Windows (x86_64)
Red Hat Enterprise Linux 8 (x86_64, ARM64)
Red Hat Enterprise Linux 9 (x86_64, PPC64LE, ARM64)
Red Hat UBI 8 (x86_64, ARM64)
Rocky Linux 8 (x86_64, ARM64)
Rocky Linux 9 (x86_64, ARM64)
SUSE Linux Enterprise Server 15 (x86_64, ARM64)
Ubuntu 20.04 LTS (x86_64, ARM64)
Ubuntu 22.04 LTS (x86_64, ARM64)
Ubuntu 24.04 LTS (x86_64, ARM64)
System User Accounts
maxscale
MaxScale process owner
mysql
Enterprise Server process owner
Quick Reference
MariaDB Enterprise Server Configuration Management
Configuration File
Configuration files (such as /etc/my.cnf
) can be used to set system-variables and options. The server must be restarted to apply changes made to configuration files.
Command-line
The server can be started with command-line options that set system-variables and options.
SQL
Users can set system-variables that support dynamic changes on-the-fly using the SET statement.
MariaDB Enterprise Server packages are configured to read configuration files from different paths, depending on the operating system. Making custom changes to Enterprise Server default configuration files is not recommended because custom changes may be overwritten by other default configuration files that are loaded later.
To ensure that your custom changes will be read last, create a custom configuration file with the z-
prefix in one of the include directories.
CentOS
Red Hat Enterprise Linux (RHEL)
SUSE Linux Enterprise Server (SLES)
/etc/my.cnf.d/z-custom-mariadb.cnf
Debian
Ubuntu
/etc/mysql/mariadb.conf.d/z-custom-mariadb.cnf
MariaDB Enterprise Server Service Management
The systemctl
command is used to start and stop the MariaDB Enterprise Server service.
Start
sudo systemctl start mariadb
Stop
sudo systemctl stop mariadb
Restart
sudo systemctl restart mariadb
Enable during startup
sudo systemctl enable mariadb
Disable during startup
sudo systemctl disable mariadb
Status
sudo systemctl status mariadb
For additional information, see "Starting and Stopping MariaDB".
MariaDB Enterprise Server Logs
MariaDB Enterprise Server produces log data that can be helpful in problem diagnosis.
Log filenames and locations may be overridden in the server configuration. The default location of logs is the data directory. The data directory is specified by the https://app.gitbook.com/o/diTpXxF5WsbHqTReoBsS/s/SsmexDFPv2xG2OTyO5yV/~/changes/381/ha-and-performance/optimization-and-tuning/system-variables/server-system-variables#datadir system variable.
MaxScale Configuration Management
MaxScale can be configured using several methods. These methods make use of MaxScale's REST API.
Command-line utility to perform administrative tasks through the REST API. See MaxCtrl Commands.
MaxGUI is a graphical utility that can perform administrative tasks through the REST API.
The REST API can be used directly. For example, the curl
utility could be used to make REST API calls from the command-line. Many programming languages also have libraries to interact with REST APIs.
The procedure on these pages configures MaxScale using MaxCtrl.
MaxScale Service Management
The systemctl
command is used to start and stop the MaxScale service.
Start
sudo systemctl start maxscale
Stop
sudo systemctl stop maxscale
Restart
sudo systemctl restart maxscale
Enable during startup
sudo systemctl enable maxscale
Disable during startup
sudo systemctl disable maxscale
Status
sudo systemctl status maxscale
For additional information, see "Starting and Stopping MariaDB".
Next Step
Navigation in the procedure "Deploy Primary/Replica Topology":
This page is: Copyright © 2025 MariaDB. All rights reserved.\
Last updated
Was this helpful?