Pgbouncer connection timed out

From: Priancka Chatz <pc9926(at)gmail(dot)com>
To: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Pgbouncer connection timed out
Date: 2024-04-29 13:33:21
Message-ID: CANnOdgaJBBTNdTQeMdpMkh6MR09Xma1__Vtj0pw8ib4kTmwzRw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Priancka Chatz 2024-04-29 13:43:40 Re: Pgbouncer connection timed out
Previous Message Tejaswi K T 2024-04-27 10:58:47 Re: pgbouncer degrades while -T is used