Skip to content
Snippets Groups Projects
Commit 03cd7eb3 authored by Scott Solkhon's avatar Scott Solkhon
Browse files

Wait for MariaDB to be accessible via HAProxy

Explicitly wait for the database to be accessible via the load balancer.
Sometimes it can reject connections even when all database services are up,
possibly due to the health check polling in HAProxy.

Closes-Bug: #1840145
Change-Id: I7601bb710097a78f6b29bc4018c71f2c6283eef2
parent 41e634e2
No related branches found
No related tags found
No related merge requests found
......@@ -190,3 +190,5 @@
when:
- bootstrap_host is defined
- bootstrap_host != inventory_hostname
- import_tasks: wait_for_loadbalancer.yml
......@@ -13,6 +13,8 @@
priv: "*.*:USAGE"
run_once: True
- import_tasks: wait_for_loadbalancer.yml
- name: Creating the Percona XtraBackup database
kolla_toolbox:
module_name: mysql_db
......
---
# 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment