2

试图启动我在日志中看到的 pgbouncer:

2017-04-25 11:18:06.319 7186 FATAL @src/main.c:612 in function check_pidfile(): pidfile 存在,另一个实例正在运行?

事实上,它并没有被删除service pgbouncer stop

[root@b ~]# grep pid /etc/pgbouncer/pgbouncer.ini
pidfile = /pg/pgbouncer/pgbouncer.pid
[root@b ~]# ls -al /pg/pgbouncer/pgbouncer.pid
-rw-r--r-- 1 pgbouncer pgbouncer 5 Apr 25 10:45 /pg/pgbouncer/pgbouncer.pid

因为它在init中是硬编码的:

[root@b ~]# grep ^pid /etc/init.d/pgbouncer
pidfile=/var/run/pgbouncer/pgbouncer.pid

当我将路径更改为我在其中指定的路径时,/etc/pgbouncer/pgbouncer.ini它开始工作......

Qestion:我该怎么做才能init.d从配置中获取 pid 文件位置?

我有:

[root@b ~]# uname -a
Linux 4.9.20-11.31.amzn1.x86_64 #1 SMP Thu Apr 13 01:53:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
[root@b ~]# pgbouncer -V
pgbouncer version 1.7.2

安装它:

wget https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-ami201503-96-9.6-2.noarch.rpm
rpm -ivh pgdg-ami201503-96-9.6-2.noarch.rpm
yum install pgbouncer

.

4

0 回答 0