This page details step 3 of the 6-step procedure "Deploy Galera Cluster Topology".
This step tests MariaDB Enterprise Server.
Interactive commands are detailed. Alternatively, the described operations can be performed using automation.
Use Systemd to test whether the MariaDB Enterprise Server service is running.
This action is performed on each Enterprise Cluster node.
Check if the MariaDB Enterprise Server service is running by executing the following:
If the service is not running on any node, start the service by executing the following on that node:
Use to test the local connection to the Enterprise Server node.
This action is performed on each Enterprise Cluster node:
The sudo command is used here to connect to the Enterprise Server node using the root@localhost user account, which authenticates using the unix_socket authentication plugin. Other user accounts can be used by specifying the --user and --password command-line options.
MariaDB Enterprise Cluster is operational when the cluster has a Primary Component. Query the status variable with SHOW GLOBAL STATUS to confirm that each node belongs to the Primary Component.
This action is performed on each Enterprise Cluster node.
Check the cluster status by executing the following:
If the Value column does not contain Primary on any node, then the node is not part of the Primary Component. Investigate network connectivity between the node and the nodes in the Primary Component.
MariaDB Enterprise Cluster maintains a count of the cluster size. Query the status variable with SHOW GLOBAL STATUS to confirm the number of nodes currently in the cluster.
This action is performed on each Enterprise Cluster node.
Check the cluster size by executing the following:
If the Value column does not contain the expected number of nodes, then some nodes might not be in the cluster. Check the value of the on each node to confirm that all nodes are in the same cluster.
Use MariaDB Client to test DDL.
On a single Enterprise Cluster node, use the MariaDB Client to connect to the node:
Create a test database and InnoDB table:
On each other Enterprise Cluster node, use the MariaDB Client to connect to the node:
Confirm that the database and table exist:
If the database or table do not exist on any node, then check that:
The nodes are in the Primary Component of the same cluster.
The wsrep_osu_method system variable is not set to RSU.
Use MariaDB Client to test DML.
On a single Enterprise Cluster node, use the MariaDB Client to connect to the node:
Insert sample data into the table created in the DDL test:
On each other Enterprise Cluster node, use the MariaDB Client to connect to the node:
Execute a query to retrieve the data:
If the data is not returned on any node, then check that:
The nodes are in the Primary Component of the same cluster.
The table uses the InnoDB storage engine.
The wsrep_on system variable is set to ON.
Navigation in the procedure "Deploy Galera Cluster Topology":
This page was step 3 of 6.
Next: Step 4: Install MariaDB MaxScale
$ systemctl status mariadb$ sudo systemctl start mariadb$ sudo mariadb
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 38
Server version: 11.4.5-3-MariaDB-Enterprise MariaDB Enterprise Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>SHOW GLOBAL STATUS LIKE 'wsrep_cluster_status';
+----------------------+---------+
| Variable_name | Value |
+----------------------+---------+
| wsrep_cluster_status | Primary |
+----------------------+---------+SHOW GLOBAL STATUS LIKE 'wsrep_cluster_size';
+--------------------+---------+
| Variable_name | Value |
+--------------------+---------+
| wsrep_cluster_size | 3 |
+--------------------+---------+$ sudo mariadbCREATE DATABASE IF NOT EXISTS test;
CREATE TABLE test.contacts (
id INT PRIMARY KEY AUTO_INCREMENT,
first_name VARCHAR(50),
last_name VARCHAR(50),
email VARCHAR(100)
);$ sudo mariadbSHOW CREATE TABLE test.contacts\G;$ sudo mariadbINSERT INTO test.contacts (first_name, last_name, email)
VALUES
("Kai", "Devi", "kai.devi@example.com"),
("Lee", "Wang", "lee.wang@example.com");$ sudo mariadbSELECT * FROM test.contacts;
+----+------------+-----------+----------------------+
| id | first_name | last_name | email |
+----+------------+-----------+----------------------+
| 1 | Kai | Devi | kai.devi@example.com |
| 2 | Lee | Wang | lee.wang@example.com |
+----+------------+-----------+----------------------+This page details step 1 of the 6-step procedure "Deploy Galera Cluster Topology".
This step installs MariaDB Enterprise Server.
MariaDB Enterprise Server installations support MariaDB Enterprise Cluster, powered by Galera. MariaDB Enterprise Cluster uses the Galera Enterprise 4 wsrep provider plugin.
MariaDB Enterprise Cluster requires an odd number of 3 or more nodes. Nodes must meet requirements.
Interactive commands are detailed. Alternatively, the described operations can be performed using automation.
MariaDB Corporation provides package repositories for CentOS / RHEL (YUM) and Debian / Ubuntu (APT). A download token is required to access the MariaDB Enterprise Repository.
Customer Download Tokens are customer-specific and are available through the MariaDB Customer Portal.
To retrieve the token for your account:
Navigate to .
Log in.
Copy the Customer Download Token.
Substitute your token for CUSTOMER_DOWNLOAD_TOKEN when configuring the package repositories.
On each Enterprise ColumnStore node, install the prerequisites for downloading the software from the Web. Install on CentOS / RHEL (YUM):
Install on Debian / Ubuntu (APT):
On each Enterprise ColumnStore node, configure package repositories and specify Enterprise Server:
Checksums of the various releases of the mariadb_es_repo_setup script can be found in the section at the bottom of the page. Substitute ${checksum} in the example above with the latest checksum.
On each Enterprise Cluster node, install MariaDB Enterprise Server and MariaDB Enterprise Backup.
Install via CentOS / RHEL (YUM):
Install via Debian / Ubuntu (APT):
Install via SLES (ZYpp):
Navigation in the procedure "Deploy Galera Cluster Topology":
This page was step 1 of 6.
Next: Step 2: Start and Configure MariaDB Enterprise Server
This page details step 4 of the 6-step procedure "Deploy Galera Cluster Topology".
This step installs MariaDB MaxScale.
MariaDB Enterprise Cluster requires 1 or more MaxScale nodes.
Interactive commands are detailed. Alternatively, the described operations can be performed using automation.
MariaDB Corporation provides package repositories for YUM (RHEL / CentOS), APT (Debian / Ubuntu), and ZYpp (SLES). A download token is required to access the MariaDB Enterprise Repository.
Customer Download Tokens are customer-specific and are available through the MariaDB Customer Portal.
To retrieve the token for your account:
Navigate to
Log in.
Copy the Customer Download Token.
Substitute your token for CUSTOMER_DOWNLOAD_TOKEN when configuring the package repositories.
On the MaxScale node, install the prerequisites for downloading the software from the Web.
Install on CentOS / RHEL (YUM):
Install on Debian / Ubuntu (APT):
Install on SLES (ZYpp):
On the MaxScale node, configure package repositories and specify MariaDB MaxScale 25.01:
Checksums of the various releases of the mariadb_es_repo_setup script can be found in the section at the bottom of the page. Substitute ${checksum} in the example above with the latest checksum.
On the MaxScale node, install MariaDB MaxScale.
Install on CentOS / RHEL (YUM):
Install on Debian / Ubuntu (APT):
Install on SLES (ZYpp):
Navigation in the procedure "Deploy Galera Cluster Topology":
This page was step 4 of 6.
Next: Step 5: Start and Configure MariaDB MaxScale
$ sudo yum install curl$ sudo apt install curl apt-transport-https$ curl -LsSO https://dlm.mariadb.com/enterprise-release-helpers/mariadb_es_repo_setup$ echo "${checksum} mariadb_es_repo_setup" \
| sha256sum -c -$ chmod +x mariadb_es_repo_setup$ sudo ./mariadb_es_repo_setup --token="CUSTOMER_DOWNLOAD_TOKEN" --apply \
--skip-maxscale \
--skip-tools \
--mariadb-server-version="11.4"$ sudo yum install MariaDB-server MariaDB-backup$ sudo apt update
$ sudo apt install mariadb-server mariadb-backup$ sudo zypper install MariaDB-server MariaDB-backupThis page is: Copyright Β© 2025 MariaDB. All rights reserved.
This page is: Copyright Β© 2025 MariaDB. All rights reserved.
This page is: Copyright Β© 2025 MariaDB. All rights reserved.
$ sudo yum install curl$ sudo apt install curl apt-transport-https$ sudo zypper install curl$ curl -LsSO https://dlm.mariadb.com/enterprise-release-helpers/mariadb_es_repo_setup
$ echo "${checksum} mariadb_es_repo_setup" \
| sha256sum -c -
$ chmod +x mariadb_es_repo_setup
$ sudo ./mariadb_es_repo_setup --token="CUSTOMER_DOWNLOAD_TOKEN" --apply \
--skip-server \
--skip-tools \
--mariadb-maxscale-version="25.01"$ sudo yum install maxscale$ sudo apt install maxscale$ sudo zypper install maxscaleSoftware Version
Diagram
Features
Enterprise Server 10.4
Enterprise Server 10.5
Enterprise Server 10.6
Enterprise Server 11.4
Multi-Primary Cluster Powered by Galera for Transactional/OLTP Workloads
InnoDB Storage Engine
Highly available
Virtually synchronous, certification-based replication
Automated provisioning of new nodes (IST/SST)
This procedure describes the deployment of the Galera Cluster topology with MariaDB Enterprise Server 11.4 and MariaDB MaxScale 25.01.
MariaDB Enterprise Cluster is powered by Galera.
MariaDB Enterprise Cluster provides read scalability and fault tolerance through virtually synchronous multi-primary certification-based write-set replication (wsrep).
This procedure has 6 steps, which are executed in sequence.
MariaDB products can be deployed in many different topologies to suit specific use cases. Enterprise Cluster can be deployed on its own, or integrated with MariaDB Replication to integrate with other clusters or topologies.
This procedure represents basic product capability with 3 Enterprise Cluster nodes and 1 MaxScale node.
This page provides an overview of the topology, requirements, and deployment procedures.
Please read and understand this procedure before executing.
Procedure Steps
Customers can obtain support by submitting a support case.
The following components are deployed during this procedure:
MariaDB Enterprise Cluster topology provides read scalability through certification-based write-set replication (wsrep) that is multi-primary and virtually synchronous.
The Enterprise Cluster topology consists of:
1 or more MaxScale nodes
3 or more MariaDB Enterprise Servers (ES) configured as Enterprise Cluster nodes
The MaxScale nodes:
Monitor the health and availability of each Enterprise Cluster node using the Galera Monitor (galeramon)
Accept client and application connections
Route queries to the Enterprise Cluster nodes using the Read Connection (readconnroute) or the Read/Write Split (readwritesplit) routers.
The Enterprise Cluster nodes:
Receive queries from MaxScale
Store data locally using the InnoDB storage engine
Perform certification-based virtually synchronous replication to other Enterprise Cluster nodes
Provide State Snapshot Transfers (SST) to bring MariaDB Enterprise Server nodes into sync with the cluster
These requirements are for the Galera Cluster topology when deployed with MariaDB Enterprise Server and MariaDB MaxScale 25.01.
MaxScale nodes, 1 or more are required.
Enterprise Cluster nodes, 3 or more are required.
To avoid problems in establishing a quorum in the event of a network partition or outage, MariaDB recommends deploying an odd number of Enterprise Cluster nodes. When using multiple network switches, deploy across an odd number of switches, each with an odd number of nodes. When using multiple data centers, deploy across an odd number of data centers, each with an odd number of switches.
In alignment to the enterprise lifecycle, the Galera Cluster topology with MariaDB Enterprise Server 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)
MariaDB Enterprise Server Configuration Management
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.
The systemctl command is used to start and stop the MariaDB Enterprise Server service. The galera_new_cluster and galera_recovery scripts are used for Enterprise Cluster-specific operations.
For additional information, see "".
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 datadir system variable.
MaxScale can be configured using several methods. These methods make use of MaxScale's .
The procedure on these pages configures MaxScale using MaxCtrl.
The systemctl command is used to start and stop the MaxScale service.>
For additional information, see "".
Navigation in the procedure "Deploy Galera Cluster Topology":
Next: Step 1: Install MariaDB Enterprise Server
This page is: Copyright Β© 2025 MariaDB. All rights reserved.
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)
Bootstrap a cluster node
sudo galera_new_cluster
Recover a cluster node's position
sudo galera_recovery
<hostname>-bin
Scales reads via MaxScale
Enterprise Server 10.3+, MariaDB Enterprise Cluster (powered by Galera), MaxScale 2.5+
Step 1
Step 2
Step 3
Step 4
Step 5
Step 6
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 leverages the Galera Enterprise 4 wsrep provider plugin
Provides virtually synchronous multi-primary replication for MariaDB Enterprise Server
All nodes can handle both reads and writes
Replicates write-sets to all other nodes in the cluster
Supports data-at-rest encryption of the write-set cache
General purpose storage engine
ACID-compliant
Performance
Required for Enterprise Cluster
Galera Monitor
Tracks changes in the state of MariaDB Enterprise Servers operating as Enterprise Cluster nodes.
Listener
Listens for client connections to MaxScale, then passes them to the router service associated with the listener
Read Connection Router
Routes connections from the listener to any available Enterprise Cluster node
Read/Write Split Router
Routes read operations from the listener to any available Enterprise Cluster node, and routes write operations from the listener to a specific server that MaxScale uses as the primary server
Server Module
Connection configuration in MaxScale to an Enterprise Cluster node
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.
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
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
<hostname>.err
server_audit.log
<hostname>-slow.log
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.
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
<hostname>.log
This page details step 5 of the 6-step procedure "Deploy Galera Cluster Topology".
This step configures MariaDB MaxScale to route connections to MariaDB Enterprise Cluster.
Interactive commands are detailed. Alternatively, the described operations can be performed using automation.
MariaDB MaxScale installations include a configuration file with some example objects. This configuration file should be replaced.
On the MaxScale node, replace the default /etc/maxscale.cnf with the following configuration:
For additional information, see "Global Parameters".
On the MaxScale node, restart the MaxScale service to ensure that MaxScale picks up the new configuration:
For additional information, see "Start and Stop Services".
MariaDB MaxScale connects to Enterprise Cluster through the client port. MaxScale requires its own user account to monitor and orchestrate Enterprise Cluster nodes.
On any Enterprise Cluster node, use the CREATE USER statement to create a new user for MaxScale:
Use the GRANT statement to grant required privileges to the MaxScale user:
Enterprise Cluster replicates the new user and privileges to the other Enterprise Cluster nodes.
MariaDB MaxScale uses server objects to define the connections it makes to MariaDB Enterprise Servers.
On the MaxScale node, use maxctrl to create a server object for each MariaDB Enterprise Server:
MaxScale uses monitors to retrieve additional information from the servers. This information is used by other services in filtering and routing connections based on the current state of the node. For Enterprise Cluster, use the .
On the MaxScale node, use maxctrl to create a Galera Monitor for the cluster:
In this example:
cluster_monitor is an arbitrary name that is used to identify the new monitor.
galeramon is the name of the module that implements the Galera Monitor.
user=MAXSCALE_USER sets the user parameter to the database user account that MaxScale uses to monitor the ES nodes.
Routers control how MaxScale balances the load between Enterprise Cluster nodes. Each router uses a different approach to routing queries. Consider the specific use case of your application and database load and select the router that best suits your needs.
Use MaxScale Read Connection Router (readconnroute) to route connections to replica servers for a read-only pool.
On the MaxScale node, use maxctrl create service to create a router:
In this example:
connection_router_service is an arbitrary name that is used to identify the new service.
readconnroute is the name of the module that implements the Read Connection Router.
user=MAXSCALE_USER sets the user parameter to the database user account that MaxScale uses to connect to the ES nodes.
These instructions reference TCP port 3308. You can use a different TCP port. The TCP port used must not be bound by any other listener.
On the MaxScale node, use the maxctrl create listener command to configure MaxScale to use a listener for the Read Connection Router (readconnroute):
In this example:
connection_router_service is the name of the readconnroute service that was previously created.
connection_router_listener is an arbitrary name that is used to identify the new listener.
3308 is the TCP port.
protocol=MariaDBClient
MaxScale Read/Write Split Router (readwritesplit) performs query-based load balancing. The router routes write queries to the primary and read queries to the replicas.
On the MaxScale node, use the maxctrl create service command to configure MaxScale to use the Read/Write Split Router (readwritesplit):
In this example:
query_router_service is an arbitrary name that is used to identify the new service.
readwritesplit is the name of the module that implements the Read/Write Split Router.
user=MAXSCALE_USER sets the user parameter to the database user account that MaxScale uses to connect to the ES nodes.
These instructions reference TCP port 3307. You can use a different TCP port. The TCP port used must not be bound by any other listener.
On the MaxScale node, use the maxctrl create listener command to configure MaxScale to use a listener for the Read/Write Split Router (readwritesplit):
In this example:
query_router_service is the name of the readwritesplit service that was previously created.
query_router_listener is an arbitrary name that is used to identify the new listener.
3307 is the TCP port.
protocol=MariaDBClient
To start the services and monitors, on the MaxScale node use maxctrl start services:
Navigation in the procedure "Deploy Galera Cluster Topology":
This page was step 5 of 6.
Next: Step 6: Test MariaDB MaxScale
password='MAXSCALE_USER_PASSWORD' sets the password parameter to the password used by the database user account that MaxScale uses to monitor the ES nodes.
--servers sets the servers parameter to the set of nodes that MaxScale should monitor. All non-option arguments after --servers are interpreted as server names.
Other Module Parameters supported by galeramon in MaxScale 25.01 can also be specified.
password=MAXSCALE_USER_PASSWORD sets the password parameter to the password used by the database user account that MaxScale uses to connect to the ES nodes.
router_options=slave sets the router_options parameter to slave, so that MaxScale only routes connections to the replica nodes.
--servers sets the servers parameter to the set of nodes to which MaxScale should route connections. All non-option arguments after --serversare interpreted as server names.
Other Module Parameters supported by readconnroute in MaxScale 25.01 can also be specified.
Other Module Parameters supported by listeners in MaxScale 25.01 can also be specified.
password=MAXSCALE_USER_PASSWORD sets the password parameter to the password used by the database user account that MaxScale uses to connect to the ES nodes.
--servers sets the servers parameter to the set of nodes to which MaxScale should route queries. All non-option arguments after --servers are interpreted as server names.
Other Module Parameters supported by readwritesplit in MaxScale 25.01 can also be specified.
Other Module Parameters supported by listeners in MaxScale 25.01 can also be specified.
Configure Read Connection Router
β’ Connection-based load balancing β’ Routes connections to Enterprise ColumnStore nodes designated as replica servers for a read-only pool β’ Routes connections to an Enterprise ColumnStore node designated as the primary server for a read-write pool.
Configure Read/Write Split
β’ Query-based load balancing β’ Routes write queries to an Enterprise ColumnStore node designated as the primary server β’ Routes read queries to Enterprise ColumnStore node designated as replica servers β’ Automatically reconnects after node failures β’ Automatically replays transactions after node failures β’ Optionally enforces causal reads
This page is: Copyright Β© 2025 MariaDB. All rights reserved.
[maxscale]
threads = auto
admin_host = 0.0.0.0
admin_secure_gui = false$ sudo systemctl restart maxscaleCREATE USER mxs@192.0.2.104 IDENTIFIED BY "passwd";GRANT SHOW DATABASES ON *.* TO mxs@192.0.2.104;
GRANT SELECT ON mysql.columns_priv TO mxs@192.0.2.104;
GRANT SELECT ON mysql.db TO mxs@192.0.2.104;
GRANT SELECT ON mysql.procs_priv TO mxs@192.0.2.104;
GRANT SELECT ON mysql.proxies_priv TO mxs@192.0.2.104;
GRANT SELECT ON mysql.roles_mapping TO mxs@192.0.2.104;
GRANT SELECT ON mysql.tables_priv TO mxs@192.0.2.104;
GRANT SELECT ON mysql.user TO mxs@192.0.2.104;$ maxctrl create server node1 192.0.2.101
$ maxctrl create server node2 192.0.2.102
$ maxctrl create server node3 192.0.2.103$ maxctrl create monitor cluster_monitor galeramon \
user=mxs \
password='MAXSCALE_USER_PASSWORD' \
--servers node1 node2 node3$ maxctrl create service connection_router_service readconnroute \
user=mxs \
password='MAXSCALE_USER_PASSWORD' \
router_options=slave \
--servers node1 node2 node3$ maxctrl create listener connection_router_service connection_router_listener 3308 \
protocol=MariaDBClient$ maxctrl create service query_router_service readwritesplit \
user=mxs \
password='MAXSCALE_USER_PASSWORD' \
--servers node1 node2 node3$ maxctrl create listener query_router_service query_router_listener 3307 \
protocol=MariaDBClient$ maxctrl start servicesThe installation process might have started the Enterprise Server service. The service should be stopped prior to making configuration changes.
On each Enterprise Cluster node, stop the MariaDB Enterprise Server service:
By default, MariaDB Enterprise Cluster requires data-in-transit encryption to secure Galera replication traffic.
MariaDB Enterprise Cluster encrypts the data using the Transport Layer Security (TLS) protocol, which is a newer version of the Secure Socket Layer (SSL) protocol.
In MariaDB Enterprise Cluster 10.5 and earlier, TLS was supported, but not required. For backward compatibility, MariaDB Enterprise Cluster supports the Provider WSREP TLS Mode, which is equivalent to Enterprise Cluster's TLS implementation in ES 10.5 and earlier. For additional information, see "WSREP TLS Modes".
TLS configuration requires 3 files.
ca-cert.pem
Certificate Authority (CA) file.
server-cert.pem
X.509 certificate file.
server-key.pem
X.509 key file.
Self-signed certificates are supported. However, in environments where security is critical, it is recommended to use certificates signed by a trusted Certificate Authority (CA).
For additional information, see "Data-in-Transit Encryption".
MariaDB Enterprise Server installations support MariaDB Enterprise Cluster, powered by Galera. MariaDB Enterprise Cluster uses the Galera Enterprise 4 wsrep provider plugin. The path to the wsrep provider plugin must be configured using the system variable.
Enterprise Cluster nodes require that you set the following system variables and options:
bind_address
The network socket Enterprise Cluster 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.
binlog_format
Enterprise Cluster requires use of the ROW Binary Log format.
innodb_autoinc_lock_mode
Enterprise Cluster requires an auto-increment lock mode of 2.
ssl_ca
Certificate Authority (CA) file in PEM format.
ssl_cert
X.509 certificate file in PEM format.
ssl_key
X.509 key file in PEM format.
Edit a configuration file and set these system variables and options:
For additional information, see "MariaDB Enterprise Server Configuration Management".
MariaDB Enterprise Cluster can be deployed alongside MariaDB Replication. Deploying MariaDB Enterprise Cluster with MariaDB Replication enables integrating Enterprise Cluster with other products and clusters, for example as separate clusters in different data centers, or as a small dedicated write cluster with two larger dedicated read clusters.
For additional information, see "Replication Configuration".
When an Enterprise Cluster node starts, it checks the addresses in the system variable to establish connections with other nodes. The node does not become active until it finds a node that belongs to the Primary Component.
To start the cluster when all nodes are down, you must bootstrap the Primary Component on one node. This allows the other nodes to connect to a working cluster.
On one Enterprise Cluster node, when all nodes are down, bootstrap the Primary Component.
Bootstrap the Primary Component:
For additional information, see "Bootstrap a Galera Cluster".
Connect with MariaDB Client:
The sudo command is used here to connect to the Enterprise Server node using the root@localhost user account, which authenticates using the unix_socket authentication plugin. Other user accounts can be used by specifying the --user and --password command-line options.
Use the SHOW STATUS statement to check the status variable:
The Enterprise Cluster node launches as the Primary Component of a single-node cluster.
To add nodes to a cluster that has a Primary Component running, complete the following procedure for each Enterprise Cluster node to be added. Nodes should be added one at a time.
On the Enterprise Cluster node being added, start MariaDB Enterprise Server:
For additional information, see "Start and Stop Services".
On the Enterprise Cluster node being added, connect with MariaDB Client:
On the bootstrapped Enterprise Cluster node, use the SHOW STATUS statement to check the status variable:
On the Enterprise Cluster node being added, use the SHOW STATUS statement to check the status variable. If is SYNCED, the node has been successfully added, and the Add Node procedure can be repeated to add more nodes.
When each new Enterprise Cluster node joins the cluster, it requests the current cluster position. If the new node is missing transactions, it initiates either a State Snapshot Transfer (SST) or an Incremental State Transfer (IST) from a donor node to synchronize its data with the Primary Component. Depending on the value of , the donor node may or may not be blocked during an SST.
When the new Enterprise Cluster node finishes its state transfer, the node updates the status variable to SYNCED. MaxScale registers the change and begins routing connections or queries to the new node.
Navigation in the procedure "Deploy Galera Cluster Topology":
This page was step 2 of 6.
Next: Step 3: Test MariaDB Enterprise Server
This page is: Copyright Β© 2025 MariaDB. All rights reserved.
$ sudo systemctl stop mariadb[mariadb]
bind_address = 0.0.0.0
binlog_format = ROW
innodb_autoinc_lock_mode = 2
wsrep_cluster_address = gcomm://192.0.2.101,192.0.2.102,192.0.2.103
wsrep_cluster_name = example-cluster
wsrep_on = ON
# wsrep provider path for Debian and Ubuntu:
wsrep_provider = /usr/lib/galera/libgalera_enterprise_smm.so
# wsrep provider path for CentOS, RHEL, and SLES:
# wsrep_provider = /usr/lib64/galera/libgalera_enterprise_smm.so
wsrep_provider_options = "gcache.size=2G;gcs.fc_limit=128"
# TLS Configuration
ssl_ca = /path/to/ca-cert.pem
ssl_cert = /path/to/sever-cert.pem
ssl_key = /path/to/server-key.pem$ sudo galera_new_cluster$ sudo mariadbSHOW GLOBAL STATUS LIKE 'wsrep_cluster_size';
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| wsrep_cluster_size | 1 |
+--------------------+-------+$ sudo systemctl start mariadb$ sudo mariadbSHOW GLOBAL STATUS LIKE 'wsrep_cluster_size';
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| wsrep_cluster_size | 2 |
+--------------------+-------+SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment';
+---------------------------+--------+
| Variable_name | Value |
+---------------------------+--------+
| wsrep_local_state_comment | Synced |
+---------------------------+--------+Sets the Group Communications back-end (usually gcomm:), followed by a comma-separated list of IP addresses or domain names for each Cluster Node. It is best practice to include all Enterprise Cluster nodes in this list.
Sets the logical name for the cluster. Must be the same on all Cluster Nodes.
wsrep_on
Enables Enterprise Cluster.
Path to the Galera Enterprise 4 wsrep provider plugin. In MariaDB Enterprise Cluster 11.4, the path is /usr/lib/galera/libgalera_enterprise_smm.so on Debian and Ubuntu and /usr/lib64/galera/libgalera_enterprise_smm.so on CentOS, RHEL, and SLES.
Accepts options for the Galera Enterprise 4 wsrep provider plugin. Multiple options can be specified, separated by a semi-colon (;). For example, can be used to configure Galera cache size or to enable TLS. For a complete list of available options, see wsrep_provider_options
This page details step 6 of the 6-step procedure "Deploy Galera Cluster Topology".
This step tests MariaDB MaxScale.
Interactive commands are detailed. Alternatively, the described operations can be performed using automation.
Use command to view the global MaxScale configuration.
This action is performed on the MaxScale node:
Output should align to the global MaxScale configuration in the new configuration file you created.
Use the and commands to view the configured server objects.
This action is performed on the MaxScale node:
Obtain the full list of servers objects:
For each server object, view the configuration:
Output should align to the Server Object configuration you performed.
Use the and commands to view the configured monitors.
This action is performed on the MaxScale node:
Obtain the full list of monitors:
For each monitor, view the monitor configuration:
Output should align to the Galera Monitor (galeramon) configuration you performed.
Use the and commands to view the configured routing services.
This action is performed on the MaxScale node:
Obtain the full list of routing services:
For each service, view the service configuration:
Output should align to the Read Connection Router (readconnroute) or Read/Write Split Router (readwritesplit) configuration you performed.
Applications should use a dedicated user account. The user account must be created on the primary server.
When users connect to MaxScale, MaxScale authenticates the user connection before routing it to an Enterprise Server node. Enterprise Server authenticates the connection as originating from the IP address of the MaxScale node.
The application users must have one user account with the host IP address of the application server and a second user account with the host IP address of the MaxScale node.
The requirement of a duplicate user account can be avoided by enabling the proxy_protocol parameter for MaxScale and the proxy_protocol_networks for Enterprise Server.
This action is performed on any Enterprise Cluster node:
Connect to the node:
Create the database user account for your MaxScale node:
Replace 192.0.2.104 with the relevant IP address specification for your MaxScale node.
Passwords should meet your organization's password policies.
Grant the privileges required by your application to the database user account for your MaxScale node:
The privileges shown are designed to allow the tests in the subsequent sections to work. The user account for your production application may require different privileges.
This action is performed on any Enterprise Cluster node:
Create the database user account for your application server:
Replace 192.0.2.11 with the relevant IP address specification for your application server.
Passwords should meet your organization's password policies.
Grant the privileges required by your application to the database user account for your application server:
The privileges shown are designed to allow the tests in the subsequent sections to work. The user account for your production application may require different privileges.
To test the connection, use the MariaDB Client from your application server to connect to an Enterprise Cluster node through MaxScale.
This action is performed on the application server:
If you configured the Read Connection Router, confirm that MaxScale routes connections to the replica servers.
On the MaxScale node, use the command to view the available listeners and ports:
Open multiple terminals connected to your application server, in each use MariaDB Client to connect to the listener port for the Read Connection Router (in the example 3308):
Use the application user credentials you created for the --user and --password options.
In each terminal, query the hostname system variable to identify to which you're connected:
Different terminals should return different values since MaxScale routes the connections to different nodes.
Since the router was configured the slave router option, the Read Connection Router only routes connections to replica servers.
If you configured the Read/Write Split Router, confirm that readwritesplit correctly routes write queries.
This action is performed with multiple client connections to the MaxScale node.
On the MaxScale node, use the command to identify the Enterprise Cluster node currently operating as the primary server:
The server listed as Master is currently operating as the primary server.
On the MaxScale node, use the command to identify the correct listener port:
In the example, the listener port for the Read/Write Split router is 3307.
Use the MariaDB Client to establish multiple connections to the listener configured for the Read/Write Split routing service, query_router_listener, on the MaxScale node:
The database user account for your application server should be specified by the --user option.
Using any client connection, create a test table:
Using each client connection, insert the values of the hostname system variable into the table using the INSERT statement to identify the node that executes the statement:
Using any client connection, query the table using the SELECT statement:
The output shows the hostname from the Enterprise Cluster node operating as the primary server. (Enterprise Cluster offsets auto-increment values by node to avoid write conflicts.)
Confirm that MaxScale is routing write queries to the Enterprise Cluster node operating as the primary server by checking that the test table only contains the hostname of the correct Enterprise Cluster node.
If you configured the Read/Write Split Router, confirm that readwritesplit properly routes read queries to multiple replica servers.
This action is performed with multiple clients connected to the MaxScale node.
On the MaxScale node, use to identify the Enterprise Cluster nodes that are currently operating as replica servers:
The servers listed as Slave are currently operating as replica servers.
On the MaxScale node, use the command to identify the correct listener port:
In the example, the listener port for the Read/Write Split router is 3307.
Use the MariaDB Client to establish multiple connections to query_router_listener which is the listener configured for the Read/Write Split routing service on the MaxScale node:
The database user account for your application server should be specified by the --user option.
Using each client connection, query the hostname system variable to identify the node that executes the statement:
The output shows the hostname value from one of the Enterprise Cluster nodes operating as replica servers.
Confirm that MaxScale is routing read queries to multiple Enterprise Cluster nodes operating as replica servers by checking that different client connections return different hostname values.
For more information on different routing criteria, slave_selection_criteria
Navigation in the procedure "Deploy Galera Cluster Topology":
This page was step 6 of 6.
This procedure is complete.
This page is: Copyright Β© 2025 MariaDB. All rights reserved.
$ maxctrl show maxscaleββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Version β 25.01.2 β
ββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Commit β 3761fa7a52046bc58faad8b5a139116f9e33364c β
ββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Started At β Thu, 05 Aug 2021 20:21:20 GMT β
ββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Activated At β Thu, 05 Aug 2021 20:21:20 GMT β
ββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Uptime β 868 β
ββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Config Sync β null β
ββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Parameters β { β
β β "admin_auth": true, β
β β "admin_enabled": true, β
β β "admin_gui": true, β
β β "admin_host": "0.0.0.0", β
β β "admin_log_auth_failures": true, β
β β "admin_pam_readonly_service": null, β
β β "admin_pam_readwrite_service": null, β
β β "admin_port": 8989, β
β β "admin_secure_gui": false, β
β β "admin_ssl_ca_cert": null, β
β β "admin_ssl_cert": null, β
β β "admin_ssl_key": null, β
β β "admin_ssl_version": "MAX", β
β β "auth_connect_timeout": "10000ms", β
β β "auth_read_timeout": "10000ms", β
β β "auth_write_timeout": "10000ms", β
β β "cachedir": "/var/cache/maxscale", β
β β "config_sync_cluster": null, β
β β "config_sync_interval": "5000ms", β
β β "config_sync_password": "*****", β
β β "config_sync_timeout": "10000ms", β
β β "config_sync_user": null, β
β β "connector_plugindir": "/usr/lib64/mysql/plugin", β
β β "datadir": "/var/lib/maxscale", β
β β "debug": null, β
β β "dump_last_statements": "never", β
β β "execdir": "/usr/bin", β
β β "language": "/var/lib/maxscale", β
β β "libdir": "/usr/lib64/maxscale", β
β β "load_persisted_configs": true, β
β β "local_address": null, β
β β "log_debug": false, β
β β "log_info": false, β
β β "log_notice": true, β
β β "log_throttling": { β
β β "count": 10, β
β β "suppress": 10000, β
β β "window": 1000 β
β β }, β
β β "log_warn_super_user": false, β
β β "log_warning": true, β
β β "logdir": "/var/log/maxscale", β
β β "max_auth_errors_until_block": 10, β
β β "maxlog": true, β
β β "module_configdir": "/etc/maxscale.modules.d", β
β β "ms_timestamp": false, β
β β "passive": false, β
β β "persistdir": "/var/lib/maxscale/maxscale.cnf.d", β
β β "piddir": "/var/run/maxscale", β
β β "query_classifier": "qc_sqlite", β
β β "query_classifier_args": null, β
β β "query_classifier_cache_size": 289073971, β
β β "query_retries": 1, β
β β "query_retry_timeout": "5000ms", β
β β "rebalance_period": "0ms", β
β β "rebalance_threshold": 20, β
β β "rebalance_window": 10, β
β β "retain_last_statements": 0, β
β β "session_trace": 0, β
β β "skip_permission_checks": false, β
β β "sql_mode": "default", β
β β "syslog": true, β
β β "threads": 1, β
β β "users_refresh_interval": "0ms", β
β β "users_refresh_time": "30000ms", β
β β "writeq_high_water": 16777216, β
β β "writeq_low_water": 8192 β
β β } β
ββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ$ maxctrl list serversββββββββββ¬ββββββββββββββ¬βββββββ¬ββββββββββββββ¬ββββββββββββββββββββββββββ¬βββββββ
β Server β Address β Port β Connections β State β GTID β
ββββββββββΌββββββββββββββΌβββββββΌββββββββββββββΌββββββββββββββββββββββββββΌβββββββ€
β node1 β 192.0.2.101 β 3306 β 0 β Slave, Synced, Running β β
ββββββββββΌββββββββββββββΌβββββββΌββββββββββββββΌββββββββββββββββββββββββββΌβββββββ€
β node2 β 192.0.2.102 β 3306 β 0 β Slave, Synced, Running β β
ββββββββββΌββββββββββββββΌβββββββΌββββββββββββββΌββββββββββββββββββββββββββΌβββββββ€
β node3 β 192.0.2.103 β 3306 β 0 β Master, Synced, Running β β
ββββββββββ΄ββββββββββββββ΄βββββββ΄ββββββββββββββ΄ββββββββββββββββββββββββββ΄βββββββ$ maxctrl show server node3βββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββ
β Server β node3 β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ€
β Address β 192.0.2.103 β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ€
β Port β 3306 β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ€
β State β Master, Synced, Running β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ€
β Version β 11.4.5-3-MariaDB-enterprise-log β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ€
β Last Event β master_up β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ€
β Triggered At β Thu, 05 Aug 2021 20:22:26 GMT β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ€
β Services β connection_router_service β
β β query_router_service β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ€
β Monitors β cluster_monitor β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ€
β Master ID β -1 β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ€
β Node ID β 1 β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ€
β Slave Server IDs β β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ€
β Current Connections β 1 β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ€
β Total Connections β 1 β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ€
β Max Connections β 1 β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ€
β Statistics β { β
β β "active_operations": 0, β
β β "adaptive_avg_select_time": "0ns", β
β β "connection_pool_empty": 0, β
β β "connections": 1, β
β β "max_connections": 1, β
β β "max_pool_size": 0, β
β β "persistent_connections": 0, β
β β "reused_connections": 0, β
β β "routed_packets": 0, β
β β "total_connections": 1 β
β β } β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββ€
β Parameters β { β
β β "address": "192.0.2.103", β
β β "disk_space_threshold": null, β
β β "extra_port": 0, β
β β "monitorpw": null, β
β β "monitoruser": null, β
β β "persistmaxtime": "0ms", β
β β "persistpoolmax": 0, β
β β "port": 3306, β
β β "priority": 0, β
β β "proxy_protocol": false, β
β β "rank": "primary", β
β β "socket": null, β
β β "ssl": false, β
β β "ssl_ca_cert": null, β
β β "ssl_cert": null, β
β β "ssl_cert_verify_depth": 9, β
β β "ssl_cipher": null, β
β β "ssl_key": null, β
β β "ssl_verify_peer_certificate": false, β
β β "ssl_verify_peer_host": false, β
β β "ssl_version": "MAX" β
β β } β
βββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββ$ maxctrl list monitorsβββββββββββββββββββ¬ββββββββββ¬ββββββββββββββββββββββ
β Monitor β State β Servers β
βββββββββββββββββββΌββββββββββΌββββββββββββββββββββββ€
β cluster_monitor β Running β node1, node2, node3 β
βββββββββββββββββββ΄ββββββββββ΄ββββββββββββββββββββββ$ maxctrl show monitor cluster_monitorβββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Monitor β cluster_monitor β
βββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Module β galeramon β
βββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β State β Running β
βββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Servers β node1 β
β β node2 β
β β node3 β
βββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Parameters β { β
β β .. β
β β } β
βββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Monitor Diagnostics β { β
β β .. β
β β } β
βββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββββββββββββββββββ$ maxctrl list servicesβββββββββββββββββββββββββββββ¬βββββββββββββββββ¬ββββββββββββββ¬ββββββββββββββββββββ¬ββββββββββββββββββββββ
β Service β Router β Connections β Total Connections β Servers β
βββββββββββββββββββββββββββββΌβββββββββββββββββΌββββββββββββββΌββββββββββββββββββββΌββββββββββββββββββββββ€
β connection_router_service β readconnroute β 0 β 0 β node1, node2, node3 β
βββββββββββββββββββββββββββββΌβββββββββββββββββΌββββββββββββββΌββββββββββββββββββββΌββββββββββββββββββββββ€
β query_router_service β readwritesplit β 1 β 1 β node1, node2, node3 β
βββββββββββββββββββββββββββββ΄βββββββββββββββββ΄ββββββββββββββ΄ββββββββββββββββββββ΄ββββββββββββββββββββββ$ maxctrl show service query_router_serviceβββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Service β query_router_service β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Router β readwritesplit β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β State β Started β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Started At β Thu Aug 5 20:23:38 2021 β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Current Connections β 1 β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Total Connections β 1 β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Max Connections β 1 β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Cluster β β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Servers β node1 β
β β node2 β
β β node3 β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Services β β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Filters β β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Parameters β { β
β β "auth_all_servers": false, β
β β "causal_reads": "false", β
β β "causal_reads_timeout": "10000ms", β
β β "connection_keepalive": "300000ms", β
β β "connection_timeout": "0ms", β
β β "delayed_retry": false, β
β β "delayed_retry_timeout": "10000ms", β
β β "disable_sescmd_history": false, β
β β "enable_root_user": false, β
β β "idle_session_pool_time": "-1000ms", β
β β "lazy_connect": false, β
β β "localhost_match_wildcard_host": true, β
β β "log_auth_warnings": true, β
β β "master_accept_reads": false, β
β β "master_failure_mode": "fail_instantly", β
β β "master_reconnection": false, β
β β "max_connections": 0, β
β β "max_sescmd_history": 50, β
β β "max_slave_connections": 255, β
β β "max_slave_replication_lag": "0ms", β
β β "net_write_timeout": "0ms", β
β β "optimistic_trx": false, β
β β "password": "*****", β
β β "prune_sescmd_history": true, β
β β "rank": "primary", β
β β "retain_last_statements": -1, β
β β "retry_failed_reads": true, β
β β "reuse_prepared_statements": false, β
β β "router": "readwritesplit", β
β β "session_trace": false, β
β β "session_track_trx_state": false, β
β β "slave_connections": 255, β
β β "slave_selection_criteria": "LEAST_CURRENT_OPERATIONS", β
β β "strict_multi_stmt": false, β
β β "strict_sp_calls": false, β
β β "strip_db_esc": true, β
β β "transaction_replay": false, β
β β "transaction_replay_attempts": 5, β
β β "transaction_replay_max_size": 1073741824, β
β β "transaction_replay_retry_on_deadlock": false, β
β β "type": "service", β
β β "use_sql_variables_in": "all", β
β β "user": "mxs", β
β β "version_string": null β
β β } β
βββββββββββββββββββββββΌββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Router Diagnostics β { β
β β "avg_sescmd_history_length": 0, β
β β "max_sescmd_history_length": 0, β
β β "queries": 1, β
β β "replayed_transactions": 0, β
β β "ro_transactions": 0, β
β β "route_all": 0, β
β β "route_master": 0, β
β β "route_slave": 1, β
β β "rw_transactions": 0, β
β β "server_query_statistics": [ β
β β { β
β β "avg_selects_per_session": 0, β
β β "avg_sess_duration": "0ns", β
β β "id": "node2", β
β β "read": 1, β
β β "total": 1, β
β β "write": 0 β
β β } β
β β ] β
β β } β
βββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ$ sudo mariadbCREATE USER 'app_user'@'192.0.2.104' IDENTIFIED BY 'app_user_passwd';GRANT ALL ON test.* TO 'app_user'@'192.0.2.104';CREATE USER 'app_user'@'192.0.2.11' IDENTIFIED BY 'app_user_passwd';GRANT ALL ON test.* TO 'app_user'@'192.0.2.11';$ mariadb --host 192.0.2.104 --port 3307
--user app_user --password$ maxctrl list listenersββββββββββββββββββββββββββββββ¬βββββββ¬βββββββ¬ββββββββββ¬ββββββββββββββββββββββββββββ
β Name β Port β Host β State β Service β
ββββββββββββββββββββββββββββββΌβββββββΌβββββββΌββββββββββΌββββββββββββββββββββββββββββ€
β connection_router_listener β 3308 β :: β Running β connection_router_service β
ββββββββββββββββββββββββββββββΌβββββββΌβββββββΌββββββββββΌββββββββββββββββββββββββββββ€
β query_router_listener β 3307 β :: β Running β query_router_service β
ββββββββββββββββββββββββββββββ΄βββββββ΄βββββββ΄ββββββββββ΄ββββββββββββββββββββββββββββ$ mariadb --host 192.0.2.104 --port 3308 \
--user app_user --passwordSELECT @@global.hostname;
+-------------------+
| @@global.hostname |
+-------------------+
| node2 |
+-------------------+$ maxctrl list serversββββββββββ¬ββββββββββββββ¬βββββββ¬ββββββββββββββ¬ββββββββββββββββββββββββββ¬βββββββ
β Server β Address β Port β Connections β State β GTID β
ββββββββββΌββββββββββββββΌβββββββΌββββββββββββββΌββββββββββββββββββββββββββΌβββββββ€
β node1 β 192.0.2.101 β 3306 β 0 β Slave, Synced, Running β β
ββββββββββΌββββββββββββββΌβββββββΌββββββββββββββΌββββββββββββββββββββββββββΌβββββββ€
β node2 β 192.0.2.102 β 3306 β 0 β Slave, Synced, Running β β
ββββββββββΌββββββββββββββΌβββββββΌββββββββββββββΌββββββββββββββββββββββββββΌβββββββ€
β node3 β 192.0.2.103 β 3306 β 0 β Master, Synced, Running β β
ββββββββββ΄ββββββββββββββ΄βββββββ΄ββββββββββββββ΄ββββββββββββββββββββββββββ΄βββββββ$ maxctrl list listeners galerarouterββββββββββββββββββββββββββββββ¬βββββββ¬ββββββββ¬ββββββββββ¬ββββββββββββββββββββββββββββ
β Name β Port β Host β State β Service β
ββββββββββββββββββββββββββββββΌβββββββΌββββββββΌββββββββββΌββββββββββββββββββββββββββββ€
β connection_router_listener β 3308 β β Running β connection_router_service β
β query_router_listener β 3307 β β Running β query_router_service β
ββββββββββββββββββββββββββββββ΄βββββββ΄ββββββββ΄ββββββββββ΄ββββββββββββββββββββββββββββ$ mariadb --host=192.0.2.104 --port=3307 \
--user=app_user --password=app_user_passwdCREATE TABLE test.load_balancing_test (
id INT PRIMARY KEY AUTO_INCREMENT,
hostname VARCHAR(256)
);INSERT INTO test.load_balancing_test (hostname)
VALUES (@@global.hostname);SELECT * FROM test.load_balancing_test;+----+----------+
| id | hostname |
+----+----------+
| 1 | node3 |
| 4 | node3 |
| 7 | node3 |
+----+----------+$ maxctrl list serversββββββββββ¬ββββββββββββββ¬βββββββ¬ββββββββββββββ¬ββββββββββββββββββββββββββ¬βββββββ
β Server β Address β Port β Connections β State β GTID β
ββββββββββΌββββββββββββββΌβββββββΌββββββββββββββΌββββββββββββββββββββββββββΌβββββββ€
β node1 β 192.0.2.101 β 3306 β 0 β Slave, Synced, Running β β
ββββββββββΌββββββββββββββΌβββββββΌββββββββββββββΌββββββββββββββββββββββββββΌβββββββ€
β node2 β 192.0.2.102 β 3306 β 0 β Slave, Synced, Running β β
ββββββββββΌββββββββββββββΌβββββββΌββββββββββββββΌββββββββββββββββββββββββββΌβββββββ€
β node3 β 192.0.2.103 β 3306 β 0 β Master, Synced, Running β β
ββββββββββ΄ββββββββββββββ΄βββββββ΄ββββββββββββββ΄ββββββββββββββββββββββββββ΄βββββββ$ maxctrl list listenersββββββββββββββββββββββββββββββ¬βββββββ¬ββββββββ¬ββββββββββ¬ββββββββββββββββββββββββββββ
β Name β Port β Host β State β Service β
ββββββββββββββββββββββββββββββΌβββββββΌββββββββΌββββββββββΌββββββββββββββββββββββββββββ€
β connection_router_listener β 3308 β β Running β connection_router_service β
β query_router_listener β 3307 β β Running β query_router_service β
ββββββββββββββββββββββββββββββ΄βββββββ΄ββββββββ΄ββββββββββ΄ββββββββββββββββββββββββββββ$ mariadb --host=192.0.2.104 --port=3307 \
--user=app_user --password=app_user_passwdSELECT @@global.hostname;
+-------------------+
| @@global.hostname |
+-------------------+
| node2 |
+-------------------+
