Monit配置PostgreSQL

5
我正在尝试在我的PostgreSQL上使用monit。我的monit配置文件如下:
检查进程postgresql,pidfile为/var/lib/postgresql/9.3/main/postmaster.pid
启动程序 =“/etc/init.d/postgresql start” 停止程序 =“/etc/init.d/postgresql stop” 如果unixsocket /var/run/postgresql/.s.PGSQL.5432协议pgsql失败,则重新启动 如果localhost端口5432协议pgsql失败,则重新启动 如果5个周期内有5个重启,则超时
当我运行cat /var/lib/postgresql/9.3/main/postmaster.pid时,结果如下:
10271 /var/lib/postgresql/9.3/main 1418738148 5432 /var/run/postgresql localhost 5432001 720899

但是我的Monit无法重新启动Postgres。我参考了http://mmonit.com/wiki/Monit/ConfigurationExamples#postgresql

有人能告诉我我做错了什么吗?

1个回答

7
尝试选择UNIX或TCP/IP协议。我会选择UNIX连接,并删除或注释掉第二个if语句... 如果主机localhost端口5432的pgsql协议连接失败,则重新启动

谢谢您的回复,我会尝试并告诉您结果。 - Amit Badheka

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接