Configuring MariaDB Galera Cluster
A number of options need to be set in order for Galera Cluster to work when using MariaDB. These should be set in the MariaDB option file.
Several options are mandatory, which means that they *must* be set in order for Galera Cluster to be enabled or to work properly with MariaDB. The mandatory options are:
wsrep_provider— Path to the Galera library
wsrep_cluster_address— See Galera Cluster address format and usage
binlog_format=ROW— See Binary Log Formats
innodb_doublewrite=1— This is the default value, but it should not be changed when using Galera provider version >= 2.0.
query_cache_size=0— Only mandatory for MariaDB versions prior to MariaDB Galera Cluster 5.5.40, MariaDB Galera Cluster 10.0.14, and MariaDB 10.1.2.
wsrep_on=ON— Enable wsrep replication (starting 10.1.1)
These are optional optimizations that can be made to improve performance.
innodb_flush_log_at_trx_commit=0— This is not usually recommended in the case of standard MariaDB. However, it is a bit safer with Galera Cluster, since inconsistencies can always be fixed by recovering from another node.
Writing Replicated Write Sets to the Binary Log
Like with MariaDB replication, write sets that are received by a node with Galera Cluster's certification-based replication are not written to the binary log by default. If you would like a node to write its replicated write sets to the binary log, then you will have to set
log_slave_updates=ON. This is especially helpful if the node is a replication master. See Using MariaDB Replication with MariaDB Galera Cluster: Configuring a Cluster Node as a Replication Master.
Like with MariaDB replication, replication filters can be used to filter write sets from being replicated by Galera Cluster's certification-based replication. However, they should be used with caution because they may not work as you'd expect.
The following replication filters are honored for InnoDB DML, but not DDL:
The following replication filters are honored for DML and DDL for tables that use both the InnoDB and MyISAM storage engines:
However, it should be kept in mind that if replication filters cause inconsistencies that lead to replication errors, then nodes may abort.
See also MDEV-421 and MDEV-6229.
Galera Cluster needs access to the following ports:
- Standard MariaDB Port (default: 3306) - For MySQL client connections and State Snapshot Transfers that use the
mysqldumpmethod. This can be changed by setting
- Galera Replication Port (default: 4567) - For Galera Cluster replication traffic, multicast replication uses both UDP transport and TCP on this port. Can be changed by setting
- Galera Replication Listening Interface (default:
0.0.0.0:4567) needs to be set using gmcast.listen_addr, either
- in wsrep_provider_options:
- or in wsrep_cluster_address
- in wsrep_provider_options:
- IST Port (default: 4568) - For Incremental State Transfers. Can be changed by setting
- SST Port (default: 4444) - For all State Snapshot Transfer methods other than
mysqldump. Can be changed by setting
Mutiple Galera Cluster Instances on One Server
If you want to run multiple Galera Cluster instances on one server, then you can do so by starting each instance with
mysqld_multi, or if you are using systemd, then you can use the relevant systemd method for interacting with multiple MariaDB instances.
You need to ensure that each instance is configured with a different
You also need to ensure that each instance is configured with different network ports.