summaryrefslogtreecommitdiffstats
path: root/setup/projects/adei
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2020-08-20 04:05:38 +0200
committerSuren A. Chilingaryan <csa@suren.me>2020-08-20 04:05:38 +0200
commit159fbcff7917d60372d780509a866384e8dc5c86 (patch)
tree78cf40d4b7437d23fff1598b59aa28c3826ec8a8 /setup/projects/adei
parenta5ff420d41999cf12b1e21549d700cdf0a48e5b8 (diff)
downloadands-159fbcff7917d60372d780509a866384e8dc5c86.tar.gz
ands-159fbcff7917d60372d780509a866384e8dc5c86.tar.bz2
ands-159fbcff7917d60372d780509a866384e8dc5c86.tar.xz
ands-159fbcff7917d60372d780509a866384e8dc5c86.zip
Detect ADEI/MySQL replication failures using slave readiness probe
Diffstat (limited to 'setup/projects/adei')
-rw-r--r--setup/projects/adei/vars/mysql.yml2
1 files changed, 1 insertions, 1 deletions
diff --git a/setup/projects/adei/vars/mysql.yml b/setup/projects/adei/vars/mysql.yml
index dd9aa0e..bb0b7f2 100644
--- a/setup/projects/adei/vars/mysql.yml
+++ b/setup/projects/adei/vars/mysql.yml
@@ -102,6 +102,6 @@ mysql:
resources: { request: { cpu: 2000m, mem: 16Gi } }
probes:
- { type: "liveness", port: 3306 }
- - { type: "readiness", command: [ /bin/sh, -i, -c, MYSQL_PWD="$MYSQL_PASSWORD" mysql -h 127.0.0.1 -u $MYSQL_USER -D $MYSQL_DATABASE -e 'SELECT 1' ], delay: "15", timeout: "5" }
+ - { type: "readiness", command: [ /bin/sh, -i, -c, test $(MYSQL_PWD="$MYSQL_PASSWORD" mysql -h 127.0.0.1 -u $MYSQL_USER -D $MYSQL_DATABASE -e 'SHOW SLAVE STATUS\G' | grep Seconds_Behind_Master | awk '{print $2}') -lt 120 ], delay: "15", timeout: "5" }
# hooks:
# - { type: "postStart", command: [ "/bin/bash", "/var/lib/init/mysql/initdb.sh" ] }