public
Last active

my.cnf for galera

  • Download Gist
my.cnf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
[mysqld]
 
### mysql general option
bind-address = 0.0.0.0
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
 
### mysql optimization
# mandatory settings for galera
innodb_autoinc_lock_mode=2
innodb_locks_unsafe_for_binlog=1
 
# query cache is not supported with wsrep
query_cache_size=0
query_cache_type=0
 
# synchronous replication allows for some optimizations (this is not required):
innodb_flush_log_at_trx_commit=0 # or 2
innodb_doublewrite=0
 
#sync_binlog=0
#innodb_flush_log_at_trx_commit=0
 
max_connections=1024
 
innodb_buffer_pool_size=400M
innodb_log_file_size=64M
 
key_buffer_size = 256M
max_allowed_packet = 32M
table_open_cache = 256
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 32M
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 4
 
#log_slave_updates
 
### galera settings
default_storage_engine=InnoDB
binlog_format=ROW
log_bin=mysql-bin
 
wsrep_cluster_name=libreit
wsrep_cluster_address=gcomm://
wsrep_node_name=NAME
 
wsrep_sst_method=xtrabackup
wsrep_sst_auth=root:PASSWORD
 
wsrep_provider=/usr/lib/libgalera_smm.so
 
# how many threads to use for applying slave writsets - cpu core * 2
wsrep_slave_threads=4
 
# change auto_increment_increment and auto_increment_offset automatically
wsrep_auto_increment_control=1
 
# enable "strictly synchronous" semantics for read operations
wsrep_causal_reads=0
 
# retry autoinc insert, which failed for duplicate key error
wsrep_drupal_282555_workaround=1
 
# Command to call when node status or cluster membership changes.
# Will be passed all or some of the following options:
# --status - new status of this node
# --uuid - UUID of the cluster
# --primary - whether the component is primary or not ("yes"/"no")
# --members - comma-separated list of members
# --index - index of this node in the list
#wsrep_notify_cmd=
 
# how many times to retry deadlocked autocommits
wsrep_retry_autocommit=2

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.