Galera Cluster System Variables

You are viewing an old version of this article. View the current version here.

This page documents system variables related to Galera Cluster. See Server System Variables for a complete list of system variables and instructions on setting them.

See also the Full list of MariaDB options, system and status variables.

wsrep_auto_increment_control

  • Description: If set to 1 (the default), will automatically adjust the auto_increment_increment and auto_increment_offset variables according to the size of the cluster, and when the cluster size changes. This avoids replication conflicts due to auto_increment. In a master-slave environment, can be set to OFF.
  • Commandline: --wsrep-auto-increment-control[={0|1}]
  • Scope: Global
  • Dynamic: Yes
  • Data Type: Boolean
  • Default Value: ON

wsrep_causal_reads

  • Description: If set to ON (OFF is default), enforces read-committed characteristics across the cluster. In the case that a master applies an event more quickly than a slave, the two could briefly be out-of-sync. With this variable set to ON, the slave will wait for the event to be applied before processing further queries. Setting to ON also results in larger read latencies. Deprecated by wsrep_sync_wait=1.
  • Commandline: --wsrep-causal-reads[={0|1}]
  • Scope: Global, Session
  • Dynamic: Yes
  • Data Type: Boolean
  • Default Value: OFF

wsrep_certify_nonPK

  • Description: When set to ON (the default), primary keys will be automatically generated for tables without one. This is required for parallel applying, and strongly recommended for all tables.
  • Commandline: --wsrep-certify-nonPK[={0|1}]
  • Scope: Global
  • Dynamic: Yes
  • Data Type: Boolean
  • Default Value: ON

wsrep_cluster_address

  • Description: The addresses of cluster nodes to connect to when starting up, for example gcomm://192.168.0.1:1234?gmcast.listen_addr=0.0.0.0:2345. Good practice is to specify all possible cluster nodes, in the form gcomm://<node1 or ip:port>,<node2 or ip2:port>,<node3 or ip3:port>. Specifying an empty ip (gcomm://) will cause the node to start a new cluster (which should not be done in the my.cnf file, as after each restart the server will not rejoin the current cluster). The variable can be changed at runtime in some configurations, and will result in the node closing the connection to any current cluster, and connecting to the new address. If specifying a port, note that this is the Galera port, not the MariaDB port.
  • Commandline: --wsrep-cluster-address=value
  • Scope: Global
  • Dynamic: No
  • Data Type: String

wsrep_cluster_name

  • Description: The name of the cluster. Nodes cannot connect to clusters with a different name, so needs to be identical on all nodes in the same cluster.
  • Commandline: --wsrep-cluster-name=value
  • Scope: Global
  • Dynamic: Yes
  • Data Type: String
  • Default Value: my_wsrep_cluster

wsrep_convert_LOCK_to_trx

  • Description: Converts LOCK/UNLOCK TABLES statements to BEGIN and COMMIT. Used mainly for getting older applications to work with a multi-master setup, use carefully, as can result in extremely large writesets.
  • Commandline: --wsrep-convert-LOCK-to-trx[={0|1}]
  • Scope: Global
  • Dynamic: Yes
  • Data Type: Boolean
  • Default Value: OFF

wsrep_data_home_dir

  • Description: Directory where wsrep provider will store its internal files.
  • Commandline: --wsrep-data-home-dir=value
  • Scope: Global
  • Dynamic: No
  • Data Type: String
  • Default Value: The datadir variable value.

wsrep_dbug_option

  • Description: Used to pass the DBUG options to the wsrep provider.
  • Commandline: --wsrep-dbug-option=value
  • Scope: Global
  • Dynamic: Yes
  • Data Type: String

wsrep_debug

  • Description: When set to ON (OFF is default), debug messages will be logged to the error log as well.
  • Commandline: --wsrep-debug[={0|1}]
  • Scope: Global
  • Dynamic: Yes
  • Data Type: Boolean
  • Default Value: OFF

wsrep_desync

  • Description: When set to ON (OFF is default), the node will be desynced from the cluster. The same effect can be achieved with a /*! WSREP_DESYNC */ query comment.
  • Commandline: --wsrep-desync[={0|1}]
  • Scope: Global
  • Dynamic: Yes
  • Data Type: Boolean
  • Default Value: OFF

wsrep_dirty_reads

  • Description: By default, when not synchronized with the group (wsrep_ready=OFF) a node will reject all queries other than SET and SHOW. If wsrep_dirty_reads is set to 1, queries which do not change data, like SELECT queries (dirty reads), creating of prepare statement, etc. will be accepted by the node.
  • Commandline: --wsrep-dirty-reads[={0|1}]
  • Scope: Global,Session
  • Dynamic: Yes
  • Data Type: Boolean
  • Default Value: OFF
  • Valid Values: ON, OFF
  • Introduced: MariaDB Galera 5.5.42, MariaDB Galera 10.0.16, MariaDB 10.1.3

wsrep_drupal_282555_workaround

  • Description: If set to ON, a workaround for Drupal/MySQL/InnoDB bug #282555 is enabled. This is a bug where, in some cases, when inserting a DEFAULT value into an AUTO_INCREMENT column, a duplicate key error may be returned.
  • Commandline: --wsrep-drupal-282555-workaround[={0|1}]
  • Scope: Global
  • Dynamic: Yes
  • Data Type: Boolean
  • Default Value: OFF

wsrep_forced_binlog_format

  • Description: A binary log format that will override any session binlog format settings.
  • Commandline: --wsrep-forced-binlog-format=value
  • Scope: Global
  • Dynamic: Yes
  • Default Value: NONE
  • Data Type: Enum
  • Valid Values: STATEMENT, ROW, MIXED or NONE (which resets the forced binlog format state).

wsrep_gtid_domain_id

  • Description: When wsrep_gtid_mode is set, this value is used as gtid_domain_id for galera transactions and also copied to the joiner nodes during state transfer. It is ignored, otherwise.
  • Commandline: --wsrep-gtid-domain-id=#
  • Scope: Global
  • Dynamic: Yes
  • Data Type: numeric
  • Default Value: 0
  • Range: 0 to 4294967295
  • Introduced: MariaDB 10.1.4

wsrep_gtid_mode

  • Description: Automatically update the (joiner) node's wsrep_gtid_domain_id value with that of donor's (received during state transfer) and use it in place of gtid_domain_id for all galera transactions. When OFF (default), wsrep_gtid_domain_id is simply ignored (backward compatibility).
  • Commandline: --wsrep-gtid-mode[={0|1}]
  • Scope: Global
  • Dynamic: Yes
  • Data Type: boolean
  • Default Value: OFF
  • Introduced: MariaDB 10.1.4

wsrep_load_data_splitting


wsrep_log_conflicts

  • Description: If set to ON (OFF is default), details of conflicting MDL as well as InnoDB locks in the cluster will be logged.
  • Commandline: --wsrep-log-conflicts[={0|1}]
  • Scope: Global
  • Dynamic: Yes
  • Data Type: Boolean
  • Default Value: OFF

wsrep_max_ws_rows


wsrep_max_ws_size


wsrep_mysql_replication_bundle

  • Description: Determines the number of replication events that are grouped together. Experimental implementation aimed to assist with bottlenecks when a single slave faces a large commit time delay. If set to 0 (the default), there is no grouping.
  • Commandline: --wsrep-mysql-replication-bundle=#
  • Scope: Global
  • Dynamic: No
  • Data Type: Numeric
  • Default Value: 0
  • Range: 0 to 1000

wsrep_node_address

  • Description: Specifies the node's network address, in the format ip address[:port]. Used in situations where autoguessing is not reliable. As of MariaDB 10.1.8, supports IPv6.
  • Commandline: --wsrep-node-address=value
  • Scope: Global
  • Dynamic: No
  • Data Type: String
  • Default Value: Primary network address, usually eth0 with a default port of 4567

wsrep_node_incoming_address

  • Description: This is the address from which the node listens for client connections. If an address is not specified or it's set to AUTO (default), mysqld uses either --bind-address or --wsrep-node-address, or tries to get one from the list of available network interfaces, in the same order.
  • Commandline: --wsrep-node-incoming-address=value
  • Scope: Global
  • Dynamic: No
  • Data Type: String
  • Default Value: AUTO

wsrep_node_name

  • Description: Name of this node. This name can be used in wsrep_sst_donor as a preferred donor. Note that multiple nodes in a cluster can have the same name.
  • Commandline: --wsrep-node-name=value
  • Scope: Global
  • Dynamic: Yes
  • Data Type: String
  • Default Value: The server's hostname.

wsrep_notify_cmd

  • Description: Command to be executed each time the node state or the cluster membership changes. Can be used for raising an alarm, configuring load balancers and so on. See the Codership Notification Script page for more details.
  • Commandline: --wsrep-notify-command=value
  • Scope: Global
  • Dynamic: Yes
  • Data Type: String
  • Default Value: Empty

wsrep_on

  • Description: Whether or not wsrep replication is enabled. If set to OFF (the default since MariaDB 10.1), no transactions from the node will be replicated to other nodes in the cluster. This variable does not affect the node's membership and thus, regardless of its value, the node keeps receiving updates from other nodes in the cluster. Before MariaDB 10.1, even though this variable is ON by default, its value get automatically adjusted based on whether mandatory configurations to turn on Galera replication have been specified. Since MariaDB 10.1, it is set to OFF by default and must be turned on to enable Galera replication.
  • Commandline: --wsrep-on[={0|1}]
  • Scope: Global, Session
  • Dynamic: Yes
  • Data Type: Boolean
  • Default Value: OFF (>= MariaDB 10.1), ON (<= MariaDB Galera Cluster 10.0),
  • Valid Values: ON, OFF

wsrep_OSU_method

  • Description: Online schema upgrade method. The default is TOI, specifying the setting without the optional parameter will set to RSU.
    • TOI: Total Order Isolation. In each cluster node, DDL is processed in the same order regarding other transactions, guaranteeing data consistency. However, affected parts of the database will be locked for the whole cluster.
    • RSU: Rolling Schema Upgrade. DDL processing is only done locally on the node, and the user needs perform the changes manually on each node. The node is desynced from the rest of the cluster while the processing takes place to avoid the blocking other nodes. Schema changes must be backwards compatible to avoid breaking replication when the DDL processing is complete on the single node, and replication recommences.
  • Commandline: --wsrep-OSU-method[=value]
  • Scope: Global, Session (since MariaDB Galera 10.0.19)
  • Dynamic: Yes
  • Data Type: Enum
  • Default Value: TOI
  • Valid Values: TOI, RSU

wsrep_patch_version

  • Description: Wsrep patch version, for example wsrep_25.10.
  • Commandline: None
  • Scope: Global
  • Dynamic: No
  • Data Type: String
  • Default Value: None
  • Introduced: MariaDB 10.1.5

wsrep_provider

  • Description: Location of the wsrep library.
  • Commandline: --wsrep-provider=value
  • Scope: Global
  • Dynamic: Yes
  • Data Type: String
  • Default Value: None

wsrep_provider_options

  • Description: Semicolon (;) separated list of wsrep options (see wsrep_provider_options).
  • Commandline: --wsrep-provider-options=value
  • Scope: Global
  • Dynamic: No
  • Data Type: String
  • Default Value: Empty

wsrep_recover

  • Description: Used for recovering the Global Transaction ID. If set to ON when the server starts, Galera will search for the Global Transaction ID in the log and output it to stderr, usually the error log.
  • Commandline: --wsrep-recover[={0|1}]
  • Scope: Global
  • Dynamic: No
  • Data Type: Boolean
  • Default Value: OFF

wsrep_replicate_myisam

  • Description: Whether or not DML updates for MyISAM tables will be replicated. This functionality is still experimental and should not be relied upon in production systems.
  • Commandline: --wsrep-replicate-myisam[={0|1}]
  • Scope: Global
  • Dynamic: Yes
  • Default Value: OFF
  • Data Type: Boolean
  • Valid Values: ON, OFF

wsrep_restart_slave

  • Description: If set to ON, the replication slave is restarted automatically, when node joins back to cluster.
  • Commandline: --wsrep-restart-slave[={0|1}]
  • Scope: Global
  • Dynamic: Yes
  • Default Value: OFF
  • Data Type: Boolean
  • Introduced: MariaDB Galera 5.5.39, MariaDB Galera 10.0.10

wsrep_retry_autocommit

  • Description: Number of times autocommited queries will be retried due to cluster-wide conflicts before returning an error to the client. If set to 0, no retries will be attempted, while a value of 1 (the default) or more specifies the number of retries attempted. Can be useful to assist applications using autocommit to avoid deadlocks.
  • Commandline: --wsrep-retry-autocommit=value
  • Scope: Global
  • Dynamic: No
  • Data Type: Numeric
  • Default Value: 1
  • Range: 0 to 10000

wsrep_slave_FK_checks

  • Description: If set to ON (the default), the applier slave thread performs foreign key constraint checks.
  • Commandline: --wsrep-slave-FK-checks[={0|1}]
  • Scope: Global
  • Dynamic: Yes
  • Data Type: Boolean
  • Default Value: ON
  • Introduced: MariaDB Galera 5.5.39, MariaDB Galera 10.0.12

wsrep_slave_threads

  • Description: Number of threads used for applying slave writesets in parallel. Galera parallel replication is only applied to transactions when safe to do so. If changed from the default (1), as a rough guideline consider using twice the number of CPU cores, and a quarter the number of writing clients used by other connections. This can be particularly useful when the node's state is JOINED, because it makes the catchup process faster. Note however that, if consistency problems frequently occur, setting the value to 1 will probably fix the problem.
  • Commandline: --wsrep-slave-threads=#
  • Scope: Global
  • Dynamic: Yes
  • Data Type: Numeric
  • Default Value: 1
  • Range: 1 to 512

wsrep_slave_UK_checks

  • Description: If set to ON, the applier slave thread performs secondary index uniqueness checks.
  • Commandline: --wsrep-slave-UK-checks[={0|1}]
  • Scope: Global
  • Dynamic: Yes
  • Data Type: Boolean
  • Default Value: OFF
  • Introduced: MariaDB Galera 5.5.39, MariaDB Galera 10.0.12

wsrep_sst_auth

  • Description: Username and password of the user to use for replication. Unused if wsrep_sst_method is set to rsync, while for other methods it should be in the format <user>:<password>. The contents are masked in logs and when querying the value with SHOW VARIABLES.
  • Commandline: --wsrep-sst-auth=value
  • Scope: Global
  • Dynamic: Yes
  • Data Type: String
  • Default Value: (Empty)

wsrep_sst_donor

  • Description: Comma-separated list (from 5.5.33) or name (as per wsrep_node_name) of the servers as donors, or the source of the state transfer, in order of preference. The donor-selection algorithm, in general, prefers a donor capable of transferring only the missing transactions (IST) to the joiner node, instead of the complete state (SST). Thus, it starts by looking for an IST-capable node in the given donor list followed by rest of the nodes in the cluster. In case multiple candidate nodes are found outside the specified donor list, the node in the same segment (gmcast.segment) as the joiner is preferred. If none of the existing nodes in the cluster can serve the missing transactions through IST, the algorithm moves on to look for a suitable node to transfer the entire state (SST). It first looks at the nodes specified in the donor list (irrespective of their segment). If no suitable donor is still found, the rest of the donor nodes are checked for suitability only if the donor list has a "terminating-comma". Note that a stateless node (the Galera arbitrator) can never be a donor.
  • Commandline: --wsrep-sst-donor=value
  • Scope: Global
  • Dynamic: Yes
  • Data Type: String
  • Default Value:

wsrep_sst_donor_rejects_queries

  • Description: If set to ON (OFF is default), the donor node will reject incoming queries, returning an UNKNOWN COMMAND error code. Can be used for informing load balancers that a node is unavailable.
  • Commandline: --wsrep-sst-donor-rejects-queries[={0|1}]
  • Scope: Global
  • Dynamic: Yes
  • Data Type: Boolean
  • Default Value: OFF

wsrep_sst_method

  • Description: Method used for taking the state snapshot transfer (sst). The command wsrep_sst_<wsrep_sst_method> will then be called, so a custom script can be written for this purpose. See Codership Scriptable State Snapshop page for details. Existing valid values include rsync (the default), mysqldump, xtrabackup and xtrabackup-v2, which use those respective methods to perform the state snapshop transfer, or skip. skip skips the transfer and should only be used temporarily, for example when starting the cluster and manually restoring data. See also the mysqldump and Xtrabackup articles. Note that the rsync and mysqldump SST methods support GTID. However, the xtrabackup-v2 and xtrabackup SST methods currently do not support GTID. The xtrabackup-v2 sst method was introduced in MariaDB Galera 5.5.37 and 10.0.10.
  • Commandline: --wsrep-sst-method=value
  • Scope: Global
  • Dynamic: Yes
  • Data Type: String
  • Default Value: rsync
  • Valid Values: rsync, mysqldump, xtrabackup, xtrabackup-v2

wsrep_sst_receive_address

  • Description: This is the address where other nodes (donor) in the cluster connect to in order to send the state-transfer updates. If an address is not specified or its set to AUTO (default), mysqld uses --wsrep_node_address's value as the receiving address. However, if --wsrep_node_address is not set, it uses address from either --bind-address or tries to get one from the list of available network interfaces, in the same order. Note: setting it to localhost will make it impossible for nodes running on other hosts to reach this node.
  • Commandline: --wsrep-sst-receive-address=value
  • Scope: Global
  • Dynamic: Yes
  • Data Type: String
  • Default Value: AUTO

wsrep_start_position

  • Description: UUID sequence number.
  • Commandline: --wsrep-start-position=value
  • Scope: Global
  • Dynamic: Yes
  • Data Type: String
  • Default Value: 00000000-0000-0000-0000-000000000000:-1

wsrep_sync_wait


Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.