This page details step 2 of the 7-step procedure "Deploy Primary/Replica Topology".
This step starts and configures a MariaDB Enterprise Server to operate as a primary server in MariaDB Replication.
Interactive commands are detailed. Alternatively, the described operations can be performed using automation.
The installation process might have started the Enterprise Server service. The service should be stopped prior to making configuration changes.
Stop the MariaDB Enterprise Server service:
Enterprise Server nodes require that you set the following system variables and options:
MariaDB Enterprise Server also supports .
Group commit can help performance by reducing I/O.
If you would like to configure parallel replication on replica servers, then you must also configure group commit on the primary server.
On each Enterprise Server node, edit a configuration file and set these system variables and options:
Set the server_id option to a value that is unique for each Enterprise Server node.
Start MariaDB Enterprise Server. If the Enterprise Server process is already running, restart it to apply the changes from the configuration file.
For additional information, see "".
The Primary/Replica topology requires several user accounts. Each user account should be created on the primary server, so that it is replicated to the replica servers.
Primary/Replica uses MariaDB Replication to replicate writes between the primary and replica servers. As MaxScale can promote a replica server to become a new primary in the event of node failure, all nodes must have a replication user.
The action is performed on the primary server.
Create the replication user and grant it the required privileges:
Use the CREATE USER statement to create replication user.
Replace the referenced IP address with the relevant address for your environment.
Ensure that the user account can connect to the primary server from each replica.
Grant the user account the required privileges with the GRANT statement.
The following privileges are required:
Use this username and password for the MASTER_USER and MASTER_PASSWORD in the CHANGE MASTER TO statement when configuring replica servers in Step 3.
Primary/Replica uses MariaDB MaxScale 25.01 to load balance between the nodes. MaxScale requires a database user to connect to the primary server when routing queries and to promote replicas in the event that the primary server fails.
This action is performed on the primary server.
Use the statement to create the MaxScale user:
Replace the referenced IP address with the relevant address for your environment.
Ensure that the user account can connect from the IP address of the MaxScale instance.
Use the statement to grant the privileges required by the router:
Use the statement to grant privileges required by the MariaDB Monitor.
The following privileges are required:
Navigation in the procedure "Deploy Primary/Replica Topology":
This page was step 2 of 7.
Next: Step 3: Start and Configure MariaDB Enterprise Server on Replica Servers
The network socket Enterprise Server listens on for incoming TCP/IP client connections. On Debian or Ubuntu, this system variable must be set to override the 127.0.0.1 default configuration.
Set this option to the file you want to use for the Binary Log. Setting this option enables binary logging.
Sets the numeric Server ID for this MariaDB Enterprise Server. The value set on this option must be unique to each node.
Sets the number of transactions that the server commits as a group to the binary log.
Sets the number of microseconds that the server waits for transactions to group commit before it commits the current group.
$ sudo systemctl stop mariadb[mariadb]
bind_address = 0.0.0.0
log_bin = mariadb-bin.log
server_id = 1$ systemctl start mariadbCREATE USER 'repl'@'192.0.2.%' IDENTIFIED BY 'repl_passwd';GRANT REPLICATION SLAVE,
REPLICATION CLIENT
ON *.* TO repl@'%';CREATE USER 'mxs'@'192.0.2.%'
IDENTIFIED BY 'mxs_passwd';GRANT SHOW DATABASES ON *.* TO 'mxs'@'192.0.2.%';
GRANT SELECT ON mysql.columns_priv TO 'mxs'@'192.0.2.%';
GRANT SELECT ON mysql.db TO 'mxs'@'192.0.2.%';
GRANT SELECT ON mysql.procs_priv TO 'mxs'@'192.0.2.%';
GRANT SELECT ON mysql.proxies_priv TO 'mxs'@'192.0.2.%';
GRANT SELECT ON mysql.roles_mapping TO 'mxs'@'192.0.2.%';
GRANT SELECT ON mysql.tables_priv TO 'mxs'@'192.0.2.%';
GRANT SELECT ON mysql.user TO 'mxs'@'192.0.2.%';GRANT SUPER,
REPLICATION CLIENT,
RELOAD,
PROCESS,
SHOW DATABASES,
EVENT
ON *.* TO 'mxs'@'192.0.2.%';This page is: Copyright © 2025 MariaDB. All rights reserved.