Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
3 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |