sidn-lxd-ansible-demo/roles/app.galera_node/templates/galera.cnf.j2

61 lines
2.0 KiB
Django/Jinja

[mysqld]
bind-address = 0.0.0.0
# Don't do name resolving on clients, because it might cause unneeded impact.
skip-name-resolve
# Galera works best with innodb tables.
default-storage-engine = innodb
# Mandatory options to make galera replication work reliable.
binlog_format = ROW
innodb_autoinc_lock_mode = 2
# Enable the wsrep provider for cluster sync support.
wsrep_provider = /usr/lib/galera/libgalera_smm.so
wsrep_on = ON
# Configure the cluster node.
wsrep_node_name= " {{ inventory_hostname }}"
wsrep_node_address = "{{ vars.network[segment.mgmt.network].address }}"
# Configure the cluster environment.
wsrep_cluster_name = "galera_cluster"
wsrep_cluster_address = "gcomm://{{ ip['galera'][segment.mgmt.network] | map(attribute='address') | join(",") }}"
{% if groups['galera-donor'] %}
# When joining the cluster, try the named donor nodes, before using a service
# node as the donor. The comma at the end is important, because that tells
# galera to try the service nodes when no donor nodes are availble.
wsrep_sst_donor = "{{ groups['galera-donor'] | join(',') }},"
{% endif %}
# The preferred way to handle replication is using the mariabackup tool.
wsrep_sst_method = mariabackup
wsrep_sst_auth = "root:{{ credentials.mysql_root.password }}"
{% if software.environment == "production" %}
# Some performance tweaks for the production environment (where more
# resources are available than in the other environments).
max_connections = 250
innodb_buffer_pool_size = 8192M
query_cache_type = 0
query_cache_size = 0
innodb_flush_log_at_trx_commit = 0
tmp_table_size = 512M
max_heap_table_size = 512M
wsrep_slave_threads = 16
wsrep_provider_options="gcs.fc_limit=80; gcs.fc_factor=0.8; gcache.size=2G; gcache.page_size=2G"
# To enable performance monitoring and investigation.
performance_schema = ON
performance-schema-instrument='stage/% = ON'
performance-schema-consumer-events-stages-current = ON
performance-schema-consumer-events-stages-history = ON
performance-schema-consumer-events-stages-history-long = ON
{% endif %}
[sst]
sst-syslog=1