O'Reilly logo

PostgreSQL Replication by Hans-Jürgen Schönig, Zoltan Böszörmenyi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring your first pgbouncer setup

Once we have compiled and installed pgbouncer, we can easily fire it up. To do so we have set up two databases on a local instance (p0 and p1). The idea of the setup performed in this example is to use pgbouncer as a proxy.

Writing a simple config file and starting pgbouncer up

In order to make pgbouncer work we can write a simple config file, which can be fed to pgbouncer:

[databases] p0 = host=localhost dbname=p0 p1 = host=localhost dbname=p1 [pgbouncer] logfile = /var/log/pgbouncer.log pidfile = /var/log/pgbouncer.pid listen_addr = 127.0.0.1 listen_port = 6432 auth_type = trust auth_file = /etc/pgbouncer/userlist.txt pool_mode = session server_reset_query = DISCARD ALL max_client_conn = 100 default_pool_size ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required