From 159fbcff7917d60372d780509a866384e8dc5c86 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Thu, 20 Aug 2020 04:05:38 +0200 Subject: Detect ADEI/MySQL replication failures using slave readiness probe --- setup/projects/adei/vars/mysql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup/projects/adei') 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" ] } -- cgit v1.2.3