mariadb: Do not use wsrep-notify.sh on Debian

Closes-Bug: #1947534

Change-Id: I08be074c3633cc4fb0a0bc6c9cb8d03eb5226d89
(cherry picked from commit b6b7401c0d)
This commit is contained in:
Michal Nasiadka 2021-10-18 12:09:03 +02:00 committed by Radosław Piliszek
parent bc114af18b
commit 1a1fb86438
5 changed files with 13 additions and 5 deletions

View File

@ -21,7 +21,7 @@ mariadb_services:
backend_tcp_extra:
- "option srvtcpka"
- "timeout server 3600s"
- "option {% if enable_mariadb_clustercheck | bool %}httpchk{% else %}mysql-check user haproxy post-41{% endif %}"
- "{% if enable_mariadb_clustercheck | bool %}option httpchk{% else %}{% if kolla_base_distro != 'debian' %}option mysql-check user haproxy post-41{% endif %}{% endif %}"
custom_member_list: "{{ internal_haproxy_members.split(';') }}"
mariadb_external_lb:
enabled: "{{ enable_external_mariadb_load_balancer|bool }}"
@ -57,8 +57,8 @@ database_max_timeout: 120
####################
# HAProxy
####################
internal_haproxy_members: "{% for host in mariadb_default_database_shard_hosts %} server {{ hostvars[host].ansible_facts.hostname }} {{ 'api' | kolla_address(host) }}:{{ mariadb_port }} check {% if enable_mariadb_clustercheck | bool %}port {{ mariadb_clustercheck_port }}{% endif %} inter 2000 rise 2 fall 5{% if not loop.first %} backup{% endif %};{% endfor %}"
external_haproxy_members: "{% for host in mariadb_default_database_shard_hosts %} server {{ host }} {{ host }}:{{ mariadb_port }} check {% if enable_mariadb_clustercheck | bool %}port {{ mariadb_clustercheck_port }}{% endif %} inter 2000 rise 2 fall 5{% if not loop.first %} backup{% endif %};{% endfor %}"
internal_haproxy_members: "{% for host in mariadb_default_database_shard_hosts %} server {{ hostvars[host].ansible_facts.hostname }} {{ 'api' | kolla_address(host) }}:{{ mariadb_port }} check {% if enable_mariadb_clustercheck | bool %}port {{ mariadb_clustercheck_port }}{% else %}{% if kolla_base_distro == 'debian' %}port {{ mariadb_port }}{% endif %}{% endif %} inter 2000 rise 2 fall 5{% if not loop.first %} backup{% endif %};{% endfor %}"
external_haproxy_members: "{% for host in mariadb_default_database_shard_hosts %} server {{ host }} {{ host }}:{{ mariadb_port }} check {% if enable_mariadb_clustercheck | bool %}port {{ mariadb_clustercheck_port }}{% else %}{% if kolla_base_distro == 'debian' %}port {{ mariadb_port }}{% endif %}{% endif %} inter 2000 rise 2 fall 5{% if not loop.first %} backup{% endif %};{% endfor %}"
####################
# Docker

View File

@ -98,6 +98,7 @@
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
- not enable_mariadb_clustercheck | bool
- kolla_base_distro != 'debian'
with_dict: "{{ mariadb_services }}"
notify:
- restart mariadb

View File

@ -40,7 +40,7 @@ wsrep_node_name={{ ansible_facts.hostname }}
wsrep_sst_method={{ sst_method }}
wsrep_sst_auth={{ database_user }}:{{ database_password }}
wsrep_slave_threads=4
{% if not enable_mariadb_clustercheck | bool %}
{% if not enable_mariadb_clustercheck | bool and kolla_base_distro != 'debian' %}
wsrep_notify_cmd=/usr/local/bin/wsrep-notify.sh
{% endif %}
wsrep_on = ON

View File

@ -7,7 +7,8 @@
"dest": "/etc/{{ mysql_dir }}/my.cnf",
"owner": "mysql",
"perm": "0600"
}{% if not enable_mariadb_clustercheck | bool %},
}{% if not enable_mariadb_clustercheck | bool and kolla_base_distro != 'debian' %},
}
{
"source": "{{ container_config_directory }}/wsrep-notify.sh",
"dest": "/usr/local/bin/wsrep-notify.sh",

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Fixes an issue on Debian with single node MariaDB deployments with
HAProxy disabled.
See `bug 1947534 <https://launchpad.net/bugs/1947534>`__ for details.