All pages
Powered by GitBook
1 of 1

Loading...

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.

Mandatory Options

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

  • — See

  • — See

  • — Enable wsrep replication

  • — This is the default value, or alternately (before MariaDB 10.6) or (MariaDB 10.6 and later).

    • — This is the default value, and should not be changed.

Performance-related Options

These are optional optimizations that can be made to improve performance.

  • — This is not usually recommended in the case of standard MariaDB. However, it is a safer, recommended option with Galera Cluster, since inconsistencies can always be fixed by recovering from another node.

  • — This tells InnoDB to use interleaved method. Interleaved is the fastest and most scalable lock mode, and should be used when BINLOG_FORMAT is set to ROW. Setting the auto-increment lock mode for InnoDB to interleaved, you’re allowing slaves threads to operate in parallel.

  • — This makes state transfers quicker for new nodes. You should start with four slave threads per CPU core. The logic here is that, in a balanced system, four slave threads can typically saturate a CPU core. However, I/O performance can increase this figure several times over. For example, a single-core ThinkPad R51 with a 4200 RPM drive can use thirty-two slave threads. The value should not be set higher than .

Writing Replicated Write Sets to the Binary Log

Like with , write sets that are received by a node with are not written to the by default. If you would like a node to write its replicated write sets to the , then you will have to set . This is especially helpful if the node is a replication master. See .

Replication Filters

Like with , can be used to filter write sets from being replicated by . However, they should be used with caution because they may not work as you'd expect.

The following replication filters are honored for DML, but not DDL:

The following replication filters are honored for DML and DDL for tables that use both the and 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 and .

Network Ports

Galera Cluster needs access to the following ports:

  • Standard MariaDB Port (default: 3306) - For MySQL client connections and that use the mysqldump method. 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 , either

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 , or if you are using , then you can use the relevant .

You need to ensure that each instance is configured with a different .

You also need to ensure that each instance is configured with different .

This page is licensed: CC BY-SA / Gnu FDL

in wsrep_provider_options: wsrep_provider_options='gmcast.listen_addr=tcp://<IP_ADDR>:<PORT>;'

  • or in wsrep_cluster_address

  • IST Port (default: 4568) - For Incremental State Transfers. Can be changed by setting ist.recv_addr in wsrep_provider_options.

  • SST Port (default: 4444) - For all State Snapshot Transfer methods other than mysqldump. Can be changed by setting wsrep_sst_receive_address.

  • wsrep_cluster_address
    Galera Cluster address format and usage
    binlog_format=ROW
    wsrep_on=ON
    default_storage_engine=InnoDB
    wsrep_replicate_myisam=1
    wsrep_mode=REPLICATE_ARIA,REPLICATE_MYISAM
    innodb_doublewrite=1
    innodb_flush_log_at_trx_commit=0
    innodb_autoinc_lock_mode=2
    wsrep_slave_threads=4
    wsrep_cert_deps_distance
    Galera Cluster's certification-based replication
    log_slave_updates=ON
    Using MariaDB Replication with MariaDB Galera Cluster: Configuring a Cluster Node as a Replication Master
    Galera Cluster's certification-based replication
    InnoDB
    binlog_do_db
    binlog_ignore_db
    replicate_wild_do_table
    replicate_wild_ignore_table
    InnoDB
    MyISAM
    replicate_do_table
    replicate_ignore_table
    MDEV-421
    MDEV-6229
    State Snapshot Transfers
    port
    wsrep_node_address
    gmcast.listen_addr
    mysqld_multi
    systemd
    systemd method for interacting with multiple MariaDB instances
    datadir
    network ports
    Binary Log Formats
    MariaDB replication
    binary log
    binary log
    MariaDB replication
    replication filters