From 908bffcfc2950e271fee1af24fb174fa6bee4aff Mon Sep 17 00:00:00 2001 From: "yj.bai" Date: Mon, 16 Dec 2019 17:05:09 +0800 Subject: [PATCH] Fix MariaDB galera IPv6 deployment on CentOS 7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CentOS 7 uses old galera which has multiple issues handling IPv6 addressing. This patch applies two workarounds for CentOS 7. Co-Authored-By: Jeffrey Zhang Co-Authored-By: Radosław Piliszek Change-Id: I7c178aba60c389e65075e0e6cbe4dfa5b8ce06ec Closes-Bug: #1856532 Signed-off-by: yj.bai --- ansible/roles/mariadb/templates/galera.cnf.j2 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ansible/roles/mariadb/templates/galera.cnf.j2 b/ansible/roles/mariadb/templates/galera.cnf.j2 index a66b8c87d8..cf8ce613bd 100644 --- a/ansible/roles/mariadb/templates/galera.cnf.j2 +++ b/ansible/roles/mariadb/templates/galera.cnf.j2 @@ -28,10 +28,23 @@ datadir=/var/lib/mysql/ wsrep_cluster_address=gcomm://{% if (groups['mariadb'] | length) > 1 %}{% for host in groups['mariadb'] %}{{ 'api' | kolla_address(host) | put_address_in_context('url') }}:{{ mariadb_wsrep_port }}{% if not loop.last %},{% endif %}{% endfor %}{% endif %} +{% if api_address_family == 'ipv6' and kolla_base_distro == 'centos' %} +# FIXME(jeffrey4l): Revert when using C8 (CentOS+Ussuri) +# Use [::] to avoid galera issue. +# for more info see https://github.com/codership/galera/issues/534#issuecomment-472607544 +wsrep_provider_options=gmcast.listen_addr=tcp://[::]:{{ mariadb_wsrep_port }};ist.recv_addr={{ api_interface_address | put_address_in_context('url') }}:{{ mariadb_ist_port }} +{% else %} wsrep_provider_options=gmcast.listen_addr=tcp://{{ api_interface_address | put_address_in_context('url') }}:{{ mariadb_wsrep_port }};ist.recv_addr={{ api_interface_address | put_address_in_context('url') }}:{{ mariadb_ist_port }} +{% endif %} wsrep_node_address={{ api_interface_address | put_address_in_context('url') }}:{{ mariadb_wsrep_port }} +{% if api_address_family == 'ipv6' and kolla_base_distro == 'centos' %} +# FIXME(yj.bai): Revert when using C8 (CentOS+Ussuri) +# Use IPv6-resolvable hostname to avoid galera issue. +wsrep_sst_receive_address={{ ansible_hostname }}:{{ mariadb_sst_port }} +{% else %} wsrep_sst_receive_address={{ api_interface_address | put_address_in_context('url') }}:{{ mariadb_sst_port }} +{% endif %} wsrep_provider={{ wsrep_driver }} wsrep_cluster_name="{{ database_cluster_name }}"