Step 2: Start and Configure MariaDB Enterprise Server 10.3

This page details step 2 of a 6-step procedure for deploying MariaDB Enterprise Cluster 10.3.

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.

Configure Enterprise Cluster

MariaDB Enterprise Server installations support MariaDB Enterprise Cluster, powered by Galera. MariaDB Enterprise Cluster 10.3 uses the Galera 3 wsrep provider plugin. The path to the wsrep provider plugin must be configured using the wsrep_provider system variable.

Required System Variables and Options

Enterprise Cluster nodes require that you set the following system variables and options:

System Variable/Option

Description

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.

wsrep_cluster_address

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.

wsrep_cluster_name

Sets the logical name for the cluster. Must be the same on all Cluster Nodes.

wsrep_on

Enables Enterprise Cluster.

wsrep_provider

Path to the Galera 3 wsrep provider plugin. In MariaDB Enterprise Cluster 10.3, the path is /usr/lib/galera/libgalera_smm.so on Debian and Ubuntu and /usr/lib64/galera/libgalera_smm.so on CentOS, RHEL, and SLES.

wsrep_provider_options

Accepts options for the Galera 3 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

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.1,192.0.2.2,192.0.2.3
wsrep_cluster_name       = example-cluster
wsrep_on                 = ON

# wsrep provider path for Debian and Ubuntu:
wsrep_provider = /usr/lib/galera/libgalera_smm.so

# wsrep provider path for CentOS, RHEL, and SLES:
# wsrep_provider = /usr/lib64/galera/libgalera_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_cluster_address 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.

  1. Bootstrap the Primary Component:

    $ sudo galera_new_cluster
    
  2. Use the SHOW STATUS statement to check the wsrep_cluster_size status variable:

    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.

  1. On the Enterprise Cluster node being added, start MariaDB Enterprise Server:

    $ sudo systemctl start mariadb
    
  2. On the Enterprise Cluster node being added, connect with MariaDB Client:

    $ sudo mariadb
    
  3. On the bootstrapped Enterprise Cluster node, use the SHOW STATUS statement to check the wsrep_cluster_size status variable:

    SHOW GLOBAL STATUS LIKE 'wsrep_cluster_size';
    
    +--------------------+-------+
    | Variable_name      | Value |
    +--------------------+-------+
    | wsrep_cluster_size |     2 |
    +--------------------+-------+
    
  4. On the Enterprise Cluster node being added, use the SHOW STATUS statement to check the wsrep_local_state_comment status variable. If wsrep_local_state_comment is SYNCED, 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_method , 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 wsrep_local_state_comment status variable to SYNCED. MaxScale registers the change and begins routing connections or queries to the new node.