On Ubuntu 12.04 (precise) in a Windows Azure VM I have postgres and pgbouncer running on the same machine. Everything is setup and works however when the VM is rebooted pgbouncer doesn't automatically startup.
The commands I run to get it started are the below. Note: I need to be 'postgres' user in order to start the service otherwise it fails. Also detailed answer preferrend. Linux isn't my normal OS.
sudo su postgres
pgbouncer -d -v /etc/pgbouncer/pgbouncer.ini
If helpful, this is how pgbouncer was installed:
sudo apt-get install postgresql-9.3 pgbouncer
Note: I can interact with pgbouncer service (force-reload, status, start, stop) however only after I first run the pgbouncer -d -v /etc/pgbouncer/pgbouncer.ini
command.
PgBouncer is a light-weight connection pool manager for Greenplum and PostgreSQL. PgBouncer maintains a pool for connections for each database and user combination. PgBouncer either creates a new database connection for a client or reuses an existing connection for the same user and database.
The defaults are set at 100 and 20, respectively. PgBouncer has a formula for determining the pool size and the number of clients that you should set, but the default is usually more than enough.
Edit /etc/default/pgbouncer
and set
START=1
Then start pgbouncer
using the init script:
/etc/init.d/pgbouncer start
The init script will automatically start pgbouncer on boot. But you need to make that START=1
setting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With