patternsqlMinor
starting pgbouncer on startup
Viewed 0 times
pgbouncerstartingstartup
Problem
I installed pgbouncer and configured it and it starts only via using this command
however using service pgbouncer start it dose not start. I then set up supervior with this settings to mannage it which works fine.
when i reboot the system pgbouncer dose not work,looking into the pgbouncer log here is what the error says
and looking into supervisor log this is what it says
can any one help out with this please
pgbouncer /etc/pgbouncer/pgbouncer.inihowever using service pgbouncer start it dose not start. I then set up supervior with this settings to mannage it which works fine.
[program:pgbouncer]
command=pgbouncer /etc/pgbouncer/pgbouncer.ini
stdout_logfile=/var/log/supervisor/pg_bouncer.log
stderr_logfile=/var/log/supervisor/pg_bouncer_error.log
autostart=true
stopsignal=QUIT
redirect_stderr=true
directory=/etc/pgbouncer/
user=postgres
group=postgres
preload_app = Truewhen i reboot the system pgbouncer dose not work,looking into the pgbouncer log here is what the error says
WARNING Cannot listen on ::/6432: bind(): Address already in use
WARNING Cannot listen on unix:/var/run/postgresql/.s.PGSQL.6432: bind(): No such file or directory
FATAL @src/main.c:553 in function write_pidfile(): /var/run/pgbouncer/pgbouncer.pid: No such fileand looking into supervisor log this is what it says
LOG File descriptor limit: 1024 (H:4096), max_client_conn: 100, max fds possible: 130
LOG listening on 0.0.0.0:6432
WARNING Cannot listen on ::/6432: bind(): Address already in use
WARNING Cannot listen on unix:/var/run/postgresql/.s.PGSQL.6432: bind(): No such file or directory
FATAL @src/main.c:553 in function write_pidfile(): /var/run/pgbouncer/pgbouncer.pid: No such file or directorycan any one help out with this please
Solution
It turns out that I was putting my pidfile in /var/run which is fine for running it but when server is rebooted the file is deleted and pgbouncer can't find the file and it gives the this error
So simply moving the file to another location and chown the directory was all that was needed
FATAL @src/main.c:553 in function write_pidfile(): /var/run/pgbouncer/pgbouncer.pid: No such file or directorySo simply moving the file to another location and chown the directory was all that was needed
$ sudo mkdir ~/pgbouncer
$ sudo chown -R postgres:postgres ~/pgbouncerCode Snippets
FATAL @src/main.c:553 in function write_pidfile(): /var/run/pgbouncer/pgbouncer.pid: No such file or directory$ sudo mkdir ~/pgbouncer
$ sudo chown -R postgres:postgres ~/pgbouncerContext
StackExchange Database Administrators Q#72741, answer score: 4
Revisions (0)
No revisions yet.