[client]
default-character-set=utf8

[mysql]
default-character-set=utf8

[mysqld]
bind-address={{ api_interface_address }}
port={{ mariadb_port }}

log-error=/var/log/kolla/mariadb/mariadb.log

log-bin=mysql-bin
binlog_format=ROW
default-storage-engine=innodb
innodb_autoinc_lock_mode=2

collation-server = utf8_general_ci
init-connect='SET NAMES utf8'
character-set-server = utf8

datadir=/var/lib/mysql/

wsrep_provider=none

max_connections=10000

key_buffer_size = '64M'
max_heap_table_size = '64M'
tmp_table_size = '64M'
{% set dynamic_pool_size_mb = (hostvars[inventory_hostname]['ansible_memtotal_mb'] * 0.4) | round | int %}
{% if dynamic_pool_size_mb < 8192 %}
innodb_buffer_pool_size = '{{ dynamic_pool_size_mb }}M'
{% else %}
innodb_buffer_pool_size = '8192M'
{% endif %}

[server]
pid-file=/var/lib/mysql/mariadb.pid
