2020-10-23

PatroniCluster 3 Node: [patroni-status.sh]

#/opt/script/patroni-status.sh
#LastUpdate: #14:32 2020.10.22
################################################################
#cat /opt/script/patroni-status.sh | grep LastUpdate
################################################################
#scp /opt/script/patroni-status.sh root@srv112:/opt/script/patroni-status.sh
#scp /opt/script/patroni-status.sh root@srv113:/opt/script/patroni-status.sh
#RESTART PATRONI:
#systemctl daemon-reload; sudo systemctl restart patroni; sleep 5; sudo systemctl status patroni --no-pager;
#10.0.2.111*
#10.0.2.112*
#10.0.2.113*
################################################################
#systemctl status patroni.service
#systemctl enable patroni.service
#sudo systemctl start patroni.service
#sudo systemctl status patroni.service
################################################################
#REF: https://www.cybertec-postgresql.com/en/patroni-setting-up-a-highly-available-postgresql-cluster/
echo "############################################"
echo "DAEMON STATUS:"
sudo systemctl status patroni --no-pager;


echo "--------------------------------------------"
echo "PROCESS STATUS:"
ps aux| egrep "PID|py"
echo "--------------------------------------------"
echo "TCP STATUS:"
netstat -ntlup | egrep "PID|LISTEN" | egrep "PID|python|etcd|postgres|haproxy" | sort -t: -k2 -n
echo "--------------------------------------------"

echo "PATRONI CLUSTER STATUS:"
patronictl -c /etc/patroni.yml list postgres
echo ""
#curl http://10.0.2.111:8008 | json_pp
curl http://$(hostname -I | awk '{print $1}'):8008 | json_pp
echo "---"
echo "DONE"
#THE_END

No comments:

Post a Comment