kolla-ansible/ansible/roles/mariadb/templates/galera.cnf.j2
Dai Dang Van 74a26a91e5 Use utf8_general_ci collation as a default collation
Now, I see mariadb are using utf8_general_ci as a default collation.
- https://mariadb.com/kb/en/mariadb/supported-character-sets-and-collations/

This mean all of Devstack database will be created with utf8_general_ci collation,
so may be, one service/project can be deployed successfully via Devstack
but will be fail with Kolla deployment.

Therefore, we should use above default collation for Kolla-ansible.

Change-Id: Icbb6c15f536fc6986816c58f4fd68bfb95813e46
Closes-Bug: 1680783
2017-04-10 15:38:16 +07:00

59 lines
2.0 KiB
Django/Jinja

{%- set wsrep_driver = '/usr/lib/galera/libgalera_smm.so' if kolla_base_distro == 'ubuntu' else '/usr/lib64/galera/libgalera_smm.so' %}
{#- Disable Galera in the case of of Kubernetes as its not supported yet. Otherwise, #}
{#- mariadb will fail to start #}
{%- set wsrep_driver = 'none' if orchestration_engine == 'KUBERNETES' else wsrep_driver %}
[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_cluster_address=gcomm://{% if (groups['mariadb'] | length) > 1 %}{% for host in groups['mariadb'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ mariadb_wsrep_port }}{% if not loop.last %},{% endif %}{% endfor %}{% endif %}
wsrep_provider_options=gmcast.listen_addr=tcp://{{ api_interface_address }}:{{ mariadb_wsrep_port }};ist.recv_addr={{ api_interface_address }}:{{ mariadb_ist_port }}
wsrep_node_address={{ api_interface_address }}:{{ mariadb_wsrep_port }}
wsrep_sst_receive_address={{ api_interface_address }}:{{ mariadb_sst_port }}
wsrep_provider={{ wsrep_driver }}
wsrep_cluster_name="{{ database_cluster_name }}"
wsrep_node_name={{ ansible_hostname }}
wsrep_sst_method=xtrabackup-v2
wsrep_sst_auth={{ database_user }}:{{ database_password }}
wsrep_slave_threads=4
wsrep_notify_cmd=/usr/local/bin/wsrep-notify.sh
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