Re: Pgbouncer connection timed out

From: Priancka Chatz <pc9926(at)gmail(dot)com>
To: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Pgbouncer connection timed out
Date: 2024-04-29 14:23:42
Message-ID: CANnOdgauJ=H=af9QoaRBDUtyhbmDh22pr=HhX2zpwksoDVU9LQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

I figured the mistake : need to connect to localhost from client side where
pgbouncer is installed and it will connect to the actual db server.

On Mon, 29 Apr 2024 at 3:43 PM, Priancka Chatz <pc9926(at)gmail(dot)com> wrote:

> P.s: Database name is exttest and same is mentioned in config and
> connection string. Above mentions are an error from copying.
>
> On Mon, 29 Apr 2024 at 3:33 PM, Priancka Chatz <pc9926(at)gmail(dot)com> wrote:
>
>> Hi Pgsql-Admins,
>>
>> I am trying to install pgbouncer on a linux machine to connect to a
>> database on a different server.
>> Below are my config files:
>>
>> pgbouncer.ini :
>>
>> [databases]
>> test = host=<host endpoint> port=5432 dbname=test user=bounce
>>
>> [pgbouncer]
>> listen_addr = *
>> listen_port = 6433
>> auth_type = scram-sha-256
>> auth_file = /etc/pgbouncer/userlist.txt
>> pool_mode = session
>> max_client_conn = 100
>> default_pool_size = 20
>> logfile = /var/log/postgresql/pgbouncer.log
>> pidfile = /var/run/postgresql/pgbouncer.pid
>>
>>
>> userlist.txt :
>> "bounce" "password"
>> (I have tried giving both: plain text password, scram-sha-256 encrypted
>> password)
>>
>> Psql from the remote client machine works fine:
>> psql -h <host-endpoint> -p 5432 -d ttest -U bounce
>> Password for user bounce:
>> psql (16.2 (Ubuntu 16.2-1ubuntu4), server 15.2 (Ubuntu
>> 15.2-1.pgdg22.04+1))
>>
>> But for port 6433 it fails:
>>
>> psql -h <host-endpoint> -p 6433 -d exttest -U bounce
>> psql: error: connection to server at "<host-endpoint>" (xxx.xxx.xxx.xxx),
>> port 6433 failed: Connection timed out
>> Is the server running on that host and accepting TCP/IP connections?
>>
>> I tried using the same ini and userlist entries locally on the server and
>> changing only host=localhost and it works fine.
>>
>> What am I missing here? What should I change or check to connect using
>> pgbouncer from a remote client host?
>>
>> Thanks in advance.
>>
>> Regards,
>> Priyanka
>>
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message akshay polji 2024-04-30 07:40:56 HA Setup Review
Previous Message Priancka Chatz 2024-04-29 13:43:40 Re: Pgbouncer connection timed out