21 Mart 2022 Pazartesi

Go & PostgreSQL standby check & Web Sunucu

 

Postgresql kurulumunda replication yönetiminde repmgr kullanmak istemiş olabilirsiniz. Bu işlemden sonra uygulama sunucularından gelen istekler LB(haproxy )ile Primary/Standby sunuculara dağıtılmak istenebilir. 


Burada kullanılan xinetd servisi ve BASH script kullanılmasını güzel bulmadım. Bu nedenle sunucunun durumu kontrol eden 

 

postgres=# select pg_is_in_recovery();
pg_is_in_recovery
-------------------
t
(1 row)


pgcheck go sunucu kodu buradadır:  https://github.com/alparslanozturk/pgcheck

 

 

 

Kaynakca:

https://www.percona.com/blog/2019/11/08/configure-haproxy-with-postgresql-using-built-in-pgsql-check/



Hiç yorum yok: