Step 2: Start and Configure MariaDB Enterprise Server
This page is part of MariaDB's Documentation.
The parent of this page is: Deploy Galera Cluster Topology with Enterprise Server 10.5
Topics on this page:
Overview
This page details step 2 of the 6-step procedure "Deploy Galera Cluster Topology".
This step configures MariaDB Enterprise Servers to operate as Enterprise Cluster nodes and starts MariaDB Enterprise Cluster.
Interactive commands are detailed. Alternatively, the described operations can be performed using automation.
Stop the Enterprise Server Service
The 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:
$ sudo systemctl stop mariadb
Configure Enterprise Cluster
MariaDB Enterprise Server installations support MariaDB Enterprise Cluster, powered by Galera. MariaDB Enterprise Cluster 10.5 uses the Galera Enterprise 4 wsrep provider plugin. The path to the wsrep provider plugin must be configured using the wsrep_
Required System Variables and Options
Enterprise Cluster nodes require that you set the following system variables and options:
System Variable/Option | Description |
---|---|
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. | |
Enterprise Cluster requires use of the | |
Enterprise Cluster requires an auto-increment lock mode of | |
Sets the Group Communications back-end (usually | |
Sets the logical name for the cluster. Must be the same on all Cluster Nodes. | |
Enables Enterprise Cluster. | |
Path to the Galera Enterprise 4 wsrep provider plugin. In MariaDB Enterprise Cluster 10.5, the path is | |
Accepts options for the Galera Enterprise 4 wsrep provider plugin. Multiple options can be specified, separated by a semi-colon ( |
Example Configuration
Edit a configuration file and set these system variables and options:
[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"
For additional information, see "MariaDB Enterprise Server Configuration Management".
Configure MariaDB Replication
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".
Bootstrap the Primary Component
When an Enterprise Cluster node starts, it checks the addresses in the wsrep_
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:
$ sudo galera_new_cluster
For additional information, see "Bootstrap a Galera Cluster".
Connect with MariaDB Client:
$ sudo mariadb
The
sudo
command is used here to connect to the Enterprise Server node using theroot@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 wsrep_
cluster_ status variable:size SHOW GLOBAL STATUS LIKE 'wsrep_cluster_size';
+--------------------+-------+ | Variable_name | Value | +--------------------+-------+ | wsrep_cluster_size | 1 | +--------------------+-------+
The Enterprise Cluster node launches as the Primary Component of a single-node cluster.
Add Nodes to the 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:
$ sudo systemctl start mariadb
For additional information, see "Start and Stop Services".
On the Enterprise Cluster node being added, connect with MariaDB Client:
$ sudo mariadb
On the bootstrapped Enterprise Cluster node, use the SHOW STATUS statement to check the wsrep_
cluster_ status variable:size SHOW GLOBAL STATUS LIKE 'wsrep_cluster_size';
+--------------------+-------+ | Variable_name | Value | +--------------------+-------+ | wsrep_cluster_size | 2 | +--------------------+-------+
On the Enterprise Cluster node being added, use the SHOW STATUS statement to check the wsrep_
local_ status variable. Ifstate_ comment wsrep_local_state_comment
isSYNCED
, the node has been successfully added, and the Add Node procedure can be repeated to add more nodes.SHOW GLOBAL STATUS LIKE 'wsrep_local_state_comment';
+---------------------------+--------+ | Variable_name | Value | +---------------------------+--------+ | wsrep_local_state_comment | Synced | +---------------------------+--------+
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 wsrep_
sst_ , the donor node may or may not be blocked during an SST.method When the new Enterprise Cluster node finishes its state transfer, the node updates the wsrep_
local_ status variable tostate_ comment SYNCED
. MaxScale registers the change and begins routing connections or queries to the new node.