diff --git a/configs/db.yml b/configs/db.yml index 882db13..f9716f4 100644 --- a/configs/db.yml +++ b/configs/db.yml @@ -5,6 +5,7 @@ postgres: conn_percent: 70 alarm: enabled: true + leader_switch_hook: "echo 'leader switch'" mysql: process_limit: 50 diff --git a/scripts/monodb/pgsql-health.sh b/scripts/monodb/pgsql-health.sh index 40f93de..a1e7a10 100644 --- a/scripts/monodb/pgsql-health.sh +++ b/scripts/monodb/pgsql-health.sh @@ -30,6 +30,8 @@ function parse_config_pgsql() { SEND_ALARM=$(yaml .postgres.alarm.enabled $CONFIG_PATH_MONODB "$SEND_ALARM") + LEADER_SWICH_HOOK=$(yaml .postgres.leader_switch_hook $CONFIG_PATH_MONODB "") + if [ -z "$PATRONI_API" ] && [ -f /etc/patroni/patroni.yml ]; then PATRONI_API="$(yq -r .restapi.listen /etc/patroni/patroni.yml)" fi