Skip to content

Instantly share code, notes, and snippets.

@dubcl
Created May 17, 2018 16:24
Show Gist options
  • Save dubcl/2d7f1ec82efe61f3e0236c827c6e4687 to your computer and use it in GitHub Desktop.
Save dubcl/2d7f1ec82efe61f3e0236c827c6e4687 to your computer and use it in GitHub Desktop.
Percona cluster config
[mysqld]
## General
user=mysql
datadir=/var/lib/mysql
pid-file = /var/run/mysqld/mysqld.pid
log_bin_trust_function_creators=1
# SAFETY #
max-allowed-packet = 16M
max-connect-errors = 1000000
group_concat_max_len = 10000000
## InnoDB configuration
innodb_locks_unsafe_for_binlog
innodb_autoinc_lock_mode = 2
innodb-flush-method = O_DIRECT
innodb-log-files-in-group = 2
innodb-log-file-size = 512M
innodb-thread-concurrency = 64
innodb-flush-log-at-trx-commit = 2
innodb-file-per-table = 1
innodb-buffer-pool-size = 245760M
# CACHES AND LIMITS #
skip_name_resolve
key_buffer_size = 24M
tmp_table_size = 64M
max_heap_table_size = 64M
max_allowed_packet = 512M
query-cache-type = 0
query-cache-size = 0
max-connections = 1500
thread-cache-size = 512
open-files-limit = 65535
table-definition-cache = 4096
table-open-cache = 4096
memlock = 0
query_cache_type = 0
query_cache_size = 0
## Replication
server-id = 1 #CHANGE ON EVERY NODE
binlog_format = ROW
log_slave_updates
## Galera configuration
##wsrep_cluster_address = "gcomm://"
wsrep_cluster_address = "gcomm://LIST,OF,NODES,SEPARATED,BY,COMMA"
wsrep_sst_donor = REMOTE-DONOR-NAME
wsrep_provider = /usr/lib/libgalera_smm.so
wsrep_slave_threads = 8
wsrep_cluster_name = CLUSTER-NAME
wsrep_sst_method = xtrabackup-v2
wsrep_sst_auth = USER:PASSW0RD
wsrep_node_name = NODE-SELF-NAME
wsrep_node_address = NODE-SELF-IP
wsrep_max_ws_rows = 131072
wsrep_max_ws_size = 1073741824
wsrep_convert_LOCK_to_trx = 0
wsrep_retry_autocommit = 1
wsrep_desync = ON
wsrep_provider_options = "gcache.size=32768M; evs.keepalive_period=PT3S; evs.suspect_timeout=PT30S; evs.inactive_timeout=PT1M; evs.install_timeout=PT1M; evs.send_window=1024; evs.user_send_window=512;"
##Binary Logging
log-bin = /var/lib/mysql/mysql-bin
max_binlog_files = 10
expire-logs-days = 2
sync-binlog = 1
## Logging
log-error = /var/log/mysql/error.log
log-queries-not-using-indexes = 1
slow-query-log = 1
slow-query-log-file = /var/log/mysql/slow.log
## SST
[sst]
streamfmt = xbstream
transferfmt = socat
progress = 1
compressor = 'pigz -9'
decompressor = 'pigz -dc'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment