176 lines
4.0 KiB
INI
176 lines
4.0 KiB
INI
[mysqld]
|
|
#
|
|
# * Basic Settings
|
|
#
|
|
user = mysql
|
|
pid-file = /var/run/mysqld/mysqld.pid
|
|
socket = /var/run/mysqld/mysqld.sock
|
|
port = 3306
|
|
basedir = /usr
|
|
datadir = /var/lib/percona-xtradb-cluster
|
|
tmpdir = /tmp
|
|
lc-messages-dir = /usr/share/mysql
|
|
skip-external-locking
|
|
|
|
# Never resolve IP's to hostnames; it adds overhead
|
|
# and is not really reliable for use with ACL's.
|
|
skip-name-resolve
|
|
|
|
#
|
|
# * Networking
|
|
#
|
|
{% if bind_address -%}
|
|
bind-address = {{ bind_address }}
|
|
{% else -%}
|
|
bind-address = 0.0.0.0
|
|
{% endif %}
|
|
|
|
#
|
|
# * Fine Tuning
|
|
#
|
|
key_buffer_size = {{ key_buffer }}
|
|
table_open_cache = {{ table_open_cache }}
|
|
max_allowed_packet = 16M
|
|
thread_stack = 192K
|
|
thread_cache_size = 8
|
|
|
|
{% if myisam_recover -%}
|
|
# This replaces the startup script and checks MyISAM tables if needed
|
|
# the first time they are touched
|
|
myisam-recover = {{ myisam_recover }}
|
|
{% endif %}
|
|
|
|
{% if max_connections != -1 -%}
|
|
max_connections = {{ max_connections }}
|
|
{% endif %}
|
|
|
|
{% if wait_timeout != -1 -%}
|
|
# Seconds before clearing idle connections
|
|
wait_timeout = {{ wait_timeout }}
|
|
{% endif %}
|
|
|
|
{% if pxc_strict_mode -%}
|
|
# Avoid use of experimental and unsupported features in PXC
|
|
pxc_strict_mode = {{ pxc_strict_mode }}
|
|
{% endif %}
|
|
|
|
#
|
|
# * Query Cache Configuration
|
|
#
|
|
query_cache_limit = 1M
|
|
query_cache_size = 16M
|
|
|
|
#
|
|
# * Logging and Replication
|
|
#
|
|
#
|
|
# Error log - should be very few entries.
|
|
#
|
|
log_error = /var/log/mysql/error.log
|
|
|
|
#
|
|
# The following can be used as easy to replay backup logs or for replication.
|
|
# note: if you are setting up a replication slave, see README.Debian about
|
|
# other settings you may need to change.
|
|
{% if enable_binlogs -%}
|
|
log_bin={{ binlogs_path }}
|
|
{% endif %}
|
|
|
|
expire_logs_days = {{ binlogs_expire_days }}
|
|
max_binlog_size = {{ binlogs_max_size }}
|
|
|
|
# Required to allow trigger creation for openstack services
|
|
log_bin_trust_function_creators = 1
|
|
|
|
# In order for Galera to work correctly binlog format should be ROW
|
|
binlog_format=ROW
|
|
|
|
{% if default_storage_engine -%}
|
|
# Default storage engine
|
|
default_storage_engine = {{ default_storage_engine }}
|
|
{% endif %}
|
|
|
|
#
|
|
# * InnoDB
|
|
#
|
|
{% if innodb_file_per_table -%}
|
|
# This enables storing InnoDB tables in separate .ibd files. Note that, however
|
|
# existing InnoDB tables will remain in ibdata file(s) unles OPTIMIZE is run
|
|
# on them. Still, the ibdata1 file will NOT shrink - a full dump/import of the
|
|
# data is needed in order to get rid of large ibdata file.
|
|
innodb_file_per_table = 1
|
|
{% else -%}
|
|
innodb_file_per_table = 0
|
|
{% endif %}
|
|
|
|
# This option is driven by via the tuning-level configuration option
|
|
# safest = 1 (default)
|
|
# fast = 2
|
|
# unsafe = 0
|
|
innodb_flush_log_at_trx_commit = {{ innodb_flush_log_at_trx_commit }}
|
|
|
|
innodb_buffer_pool_size = {{ innodb_buffer_pool_size }}
|
|
|
|
{% if innodb_change_buffering -%}
|
|
innodb_change_buffering = {{ innodb_change_buffering }}
|
|
{% endif %}
|
|
|
|
{% if innodb_io_capacity -%}
|
|
innodb_io_capacity = {{ innodb_io_capacity }}
|
|
{% endif %}
|
|
|
|
{% if innodb_autoinc_lock_mode -%}
|
|
# InnoDB AUTO_INCREMENT Lock Mode
|
|
innodb_autoinc_lock_mode = {{ innodb_autoinc_lock_mode }}
|
|
{% endif %}
|
|
|
|
|
|
#
|
|
# * Galera
|
|
#
|
|
wsrep_provider={{ wsrep_provider }}
|
|
|
|
# Add address of other cluster nodes here
|
|
# Cluster connection URL contains the IPs of node#1, node#2 and node#3
|
|
# Empty when bootstrapping the cluster
|
|
wsrep_cluster_address=gcomm://{{ cluster_hosts }}
|
|
|
|
#
|
|
# Node address
|
|
wsrep_node_address={{ private_address }}
|
|
#
|
|
# SST method
|
|
wsrep_sst_method={{ sst_method }}
|
|
#
|
|
# Cluster name
|
|
wsrep_cluster_name={{ cluster_name }}
|
|
#
|
|
# Authentication for SST method
|
|
wsrep_sst_auth="sstuser:{{ sst_password }}"
|
|
|
|
{% if wsrep_log_conflicts -%}
|
|
# Log additional information about conflicts
|
|
wsrep_log_conflicts
|
|
{% endif %}
|
|
|
|
{% if wsrep_provider_options -%}
|
|
wsrep_provider_options = {{ wsrep_provider_options }}
|
|
{% endif %}
|
|
|
|
#
|
|
# * Performance Schema
|
|
#
|
|
{% if performance_schema -%}
|
|
performance_schema=On
|
|
{% else -%}
|
|
performance_schema=Off
|
|
{% endif %}
|
|
|
|
#
|
|
# * IPv6 SST configuration
|
|
#
|
|
{% if ipv6 -%}
|
|
[sst]
|
|
sockopt=,pf=ip6
|
|
{% endif %}
|