简体   繁体   中英

pid file disappears after starting pgpool with ubuntu and postgresql

I´ve installed postgresql 9.1 on ubuntu 12.04 with pgpoolII-3.3.3 and pgPoolAdmin

If I try to run pgpool from a terminal with sudo pgpool it seems to start. Viewing ubuntu file explorer I can see how a pgpool.pid file is created at /var/run/pgpool/pgpool.id (this is the path in pgpool.conf)

But after one second the file disappears.

I have tried to change the owner of the directory and the directory permissions but nothing seems to fix it.

If after that I try to stop pgpool wiht sudo pgpool -m fast stop I got an error: Error. pid file not found

It seems like the file is created and suddenly destroyed. I´m wondering why.

If I try to run pgpool from pgPoolAdmin I got this error: pgpool start failed. pgpool.pid not found.

Like other times, it´s maybe and stupid issue and I´m not being able to solve it as i don´t have a high level of knowledge on those systems.

Any idea about what to try?

Xrry Christmas

使用ls -la命令检查tmp目录并删除文件.s.PGSQL.9999和.s.PGSQL.9898并重启服务器

Solved. I think the problem was caused by a permission problem. After trying

sudo mkdir /var/run/pgpool
sudo chmod 777 /var/run/pgpool
sudo chown postgres/postgres /var/run/pgpool
sudo postgresql service restart

It seems to be working now.

Upon configuring PgPool-II, I found some documentation explaining that using the default directory /var/run/pgpool for the PID file was a bad idea, for that file could be erased when the service reboots.

The contents of the /var/run directory (including the pgpool directory) may be removed by the operating system during a reboot. The /var/run/pgpool directory should NOT be used as the location for the pgpool.pid file.

The issue seems to occur when using Ubuntu .

So a possible solution would be to store the PID file in a directory named so as to not match the name of a service that could be rebooted. For instance, you could change the pgpool.conf file :

 pid_file_name = '/var/run/pgpool4ever/pgpool.pid'

I could not try it on my own as I do not use Ubuntu, but maybe this could help someone facing a similar problem. Although I am not sure that it is very wise to go past basic Ubuntu way of working....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM