Postgresql - выбрать самую «свежую» реплику
#!/bin/sh
#set -e
psql -U postgres -d postgres -c "select * from pg_stat_replication;"
slave=$(psql --tuples-only -U postgres -d postgres "select client_addr from pg_stat_replication where usename='repluser' and sync_state='sync' order by flush_lag desc limit 1;")
echo $slave
username надо
(
Read more... )
Comments 1
Reply
Leave a comment