Merge "Wait for MariaDB to be accessible via HAProxy"
This commit is contained in:
commit
d8e961eeaa
@ -213,3 +213,5 @@
|
|||||||
when:
|
when:
|
||||||
- bootstrap_host is defined
|
- bootstrap_host is defined
|
||||||
- bootstrap_host != inventory_hostname
|
- bootstrap_host != inventory_hostname
|
||||||
|
|
||||||
|
- import_tasks: wait_for_loadbalancer.yml
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
priv: "*.*:USAGE"
|
priv: "*.*:USAGE"
|
||||||
run_once: True
|
run_once: True
|
||||||
|
|
||||||
|
- import_tasks: wait_for_loadbalancer.yml
|
||||||
|
|
||||||
- name: Creating the Percona XtraBackup database
|
- name: Creating the Percona XtraBackup database
|
||||||
become: true
|
become: true
|
||||||
kolla_toolbox:
|
kolla_toolbox:
|
||||||
|
16
ansible/roles/mariadb/tasks/wait_for_loadbalancer.yml
Normal file
16
ansible/roles/mariadb/tasks/wait_for_loadbalancer.yml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
# Explicitly wait for the database to be accessible via the load balancer.
|
||||||
|
# Sometimes it can reject connections even when all database services are up,
|
||||||
|
# due to the health check polling in HAProxy.
|
||||||
|
- name: wait for MariaDB to be available via HAProxy
|
||||||
|
wait_for:
|
||||||
|
host: "{{ database_address }}"
|
||||||
|
port: "{{ database_port }}"
|
||||||
|
connect_timeout: 1
|
||||||
|
timeout: 60
|
||||||
|
search_regex: "MariaDB"
|
||||||
|
register: check_mariadb_port
|
||||||
|
until: check_mariadb_port is success
|
||||||
|
retries: 10
|
||||||
|
delay: 6
|
||||||
|
run_once: True
|
Loading…
x
Reference in New Issue
Block a user