-
Notifications
You must be signed in to change notification settings - Fork 19
/
my.cnf.j2
100 lines (79 loc) · 2.8 KB
/
my.cnf.j2
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
bind_address = {{ galera_conf['bind_address'] }}
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
default_storage_engine = InnoDB
tmpdir = /tmp
skip-name-resolve
lc-messages-dir = /usr/share/mysql
skip-external-locking
key_buffer = 16M
max_connections = 100
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
myisam-recover = BACKUP
query_cache_limit = 1M
query_cache_size = 16M
log_error = /var/log/mysql/err.log
slow_query_log = 1
long_query_time = 2
log-queries-not-using-indexes
# server-id = 1
log_bin = /var/log/mysql/mysql-bin.log
sync_binlog = 1
binlog_format = ROW
expire_logs_days = 2
max_binlog_size = 100M
log_slave_updates
wsrep_provider = /usr/lib/libgalera_smm.so
wsrep_slave_threads = 4
wsrep_sst_method = xtrabackup
wsrep_sst_auth = {{ galera_conf['dbusers']['xtrabackup']['username'] }}:{{ galera_conf['dbusers']['xtrabackup']['password'] }}
wsrep_cluster_name = percona-cluster
{# list of cluster members #}
{% set cluster_members = [] -%}
{# flag to bootstrap #}
{% set bootstrap_cluster = 0 -%}
{# if this is the first node AND bootstrap #}
{%- if groups['galera_cluster'].index(inventory_hostname) == 0 and "bootstrap" in bootstrap_check.stdout_lines[0] %}
{%- set bootstrap_cluster = 1 %}
{% endif -%}
{%- if not bootstrap_cluster %}
{%- for node in groups['galera_cluster'] %}
{%- if hostvars[node].ansible_default_ipv4.address != ansible_eth0.ipv4.address %}
{%- set _ = cluster_members.append(hostvars[node].ansible_default_ipv4.address) -%}
{% endif -%}
{% endfor -%}
{% endif -%}
wsrep_cluster_address = gcomm://{{ ",".join(cluster_members) }}
wsrep_node_name = {{ ansible_eth0.ipv4.address }}
wsrep_provider_options = gcache.size=2G;
default_storage_engine = InnoDB
innodb_autoinc_lock_mode = 2
# innodb_locks_unsafe_for_binlog = 1
innodb_file_per_table
innodb_thread_concurrency = 0
innodb_buffer_pool_size = 50M
innodb_log_buffer_size = 64M
# innodb_flush_method = O_DIRECT
innodb_log_file_size = 500M
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
[isamchk]
key_buffer = 16M
!includedir /etc/mysql/conf.d/