Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 695
Cesar Avatar asked Dec 24 '14 16:12

Cesar


3 Answers

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.

like image 93
Cesar Avatar answered Oct 22 '22 14:10

Cesar


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

like image 3
Anup Gupta Avatar answered Oct 22 '22 15:10

Anup Gupta


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

like image 1
The Once-ler Avatar answered Oct 22 '22 15:10

The Once-ler