[client] port = 3306 socket = /var/run/mysqld/mysqld.sock [mysqld] port = 3306 datadir = /var/lib/mysql socket = /var/run/mysqld/mysqld.sock max_connections = 500 transaction-isolation = 'READ-COMMITTED' # caching and optimisations join_buffer_size = 128 table_open_cache = 64 thread_cache_size = 128 thread_stack = 256K tmp_table_size = 256M max_allowed_packet = 500M read_buffer_size = 128K slow-query-log-file = /var/log/mysql/slow-queries.log # file must first be created and owned by the MySQL user long_query_time = 5 skip-external-locking skip-name-resolve #========# # InnoDB # #========# innodb_flush_method = ALL_O_DIRECT innodb_buffer_pool_size = 2G # it should be ~70-80% of the available RAM. innodb_log_buffer_size = 8M innodb_log_file_size = 5M innodb_support_xa = 0 # OK with Galera synchronous replication innodb_flush_log_at_trx_commit = 0 # speeds things up, can lose 1 second worth of transactions if MySQL crashes. This is fine for us at the moment. innodb_doublewrite = 1 # ensures an incremental state transfer will be tried if possible innodb_file_per_table #================================# # Galera synchronous replication # #================================# binlog_format = row innodb_locks_unsafe_for_binlog = 1 server-id = 30 # change on each node! - not strictly required for Galera, but it's safer to have a unique id on each node in case normal replication is also used innodb_autoinc_lock_mode = 2 query_cache_type = 0 query_cache_size = 0 default_storage_engine = InnoDB wsrep_cluster_name = "Percona-XtraDB-Cluster" wsrep_node_name = "MySQL-0" # change this on each node! wsrep_provider=/usr/lib64/libgalera_smm.so wsrep_cluster_address = "gcomm://192.168.101.12,192.168.101.13" # set to "gcom://"" to reinitialise (reset) a node; otherwise ensure it is pointing to a valid node wsrep_slave_threads = 2 # recommended: 4 slave thread per core wsrep_retry_autocommit = 2 # how many times to retry deadlocked autocommits wsrep_convert_LOCK_to_trx = 0 wsrep_certify_nonPK = 1 # Generate fake primary keys for non-PK tables (required for multi-master and parallel applying operation) # rsync or xtrabackup; remember to create the user 'mysql'@'localhost' on each node, with all privileges for the xtrabackup-based SST to work wsrep_sst_method = xtrabackup [mysqldump] quick max_allowed_packet = 16M [mysql] no-auto-rehash # Remove the next comment character if you are not familiar with SQL #safe-updates [myisamchk] key_buffer_size = 20M sort_buffer_size = 20M read_buffer = 2M write_buffer = 2M [mysqlhotcopy] interactive-timeout