pid file disappears after starting pgpool with ubuntu and postgresql

五迷三道 提交于 2021-01-27 06:25:11

问题


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


回答1:


check the tmp directory using ls -la command and delete the file .s.PGSQL.9999 and .s.PGSQL.9898 and restart the server




回答2:


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.




回答3:


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....



来源:https://stackoverflow.com/questions/27639582/pid-file-disappears-after-starting-pgpool-with-ubuntu-and-postgresql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!