MariaDB Replication with MariaDB Xpand

MariaDB Replication can be used with MariaDB Xpand, but it requires some special configuration.

Replication to Synchronize Schemas

In an Xpand deployment, the MariaDB Xpand service automatically synchronizes the schema and data on all nodes for any tables that use the Xpand storage engine. However, many other database objects will not be automatically synchronized. Some examples of non-synchronized database objects are:

  • Databases

  • Tables that use other storage engines

  • Views

  • User accounts and privileges

  • Stored procedures and functions

  • Events

MariaDB Replication can be used to synchronize these other database objects on all nodes. Some special configuration is necessary to ensure that the schema and data for Xpand tables is not unnecessarily replicated.

Any MariaDB Enterprise Server serving as a primary must set the xpand_master_skip_dml_binlog and xpand_replicate_alter_as_create_select system variables to the values shown below:

[mariadb]
...
xpand_master_skip_dml_binlog=ON
xpand_replicate_alter_as_create_select=ON

Any MariaDB Enterprise Server serving as a replica must set the slave_ddl_exec_mode and xpand_slave_ignore_ddl system variables to the values shown below:

[mariadb]
...
slave_ddl_exec_mode=STRICT
xpand_slave_ignore_ddl=ON

In-Bound Replication to Xpand Service

In some cases, it may be desired to configure your Xpand deployment for in-bound replication. Some examples of use cases are:

  • Replicating from an Xpand deployment to a separate Xpand deployment for disaster recovery (DR).

  • Replicating from a MariaDB Enterprise Server deployment to an Xpand deployment for migration.

MariaDB Replication can be used to synchronize the Xpand deployment with the remote deployment. Some special configuration is necessary:

  • If the primary server is another Xpand deployment, the in-bound replication must be configured through the MariaDB Xpand service, rather than through the MariaDB Enterprise Server service. To do this, connect to the MariaDB Xpand service through the service's Unix socket file, which is /data/clustrix/mysql.sock by default.

  • If the primary server is a MariaDB Enterprise Server deployment, the in-bound replication should be configured through the MariaDB Enterprise Server service.

  • The MariaDB Xpand service only supports row-based replication (RBR), so the binlog_format system variable on the primary server must be set to ROW.