Re: Can anyone help setting up pgbouncer?

From: Richard Huxton <dev(at)archonet(dot)com>
To: Nick <nboutelier(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Can anyone help setting up pgbouncer?
Date: 2009-11-18 20:43:28
Message-ID: 4B045C70.40200@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Nick wrote:
> So now the only step I have left is actually connecting. Im trying to
> connect a php script to pgbouncer with
>
> $conn = pg_connect("host=127.0.0.1 dbname=bouncer1 port=6543
> user=nboutelier password=password");
>
> which results in
>
> Warning: pg_connect(): Unable to connect to PostgreSQL server: could
> not connect to server: Connection refused Is the server running on
> host "127.0.0.1" and accepting TCP/IP connections on port 6543

OK - so we have one of two possibilities:
1. pgbouncer isn't listening on localhost, port 6543
2. Some firewall is in the way

If you have root access then you can check #1. You'll get something like
this:

lsof -i | grep pgbouncer
pgbouncer ... TCP localhost:6432

For #2, check your configuration settings and logs to see if anything is
blocking you.

--
Richard Huxton
Archonet Ltd

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message akp geek 2009-11-18 21:46:35 pg_standby instructions
Previous Message Scott Felt 2009-11-18 19:04:10 Re: DB terminating