I have postgresql installed on vultr "Ubuntu 20.04". I installed Pgbouncer for connection pooling and configure it as bellow, but but pgbouncer is rejecting connection with the vultr ip address. it is only working with "localhost (127.0.0.1)". I have added both port "6432 and 5432" to the firewall rules but still cant connect, the command I tried was "sudo psql -h 139..22*.* -U myuser -d mydb -p 6432". I keep on getting the error "psql: error: could not connect to server: Connection refused. Is the server running on host "139..22*.*" and accepting TCP/IP connections on port 6432?"
# postgresql.conf file bellow:
listen_addresses = '*'
port = 5432
# pgbouncer.ini file bellow:
[databases]
postgres = host=127.0.0.1 port=5432 dbname=postgres
mydb = host=127.0.0.1 port=5432 dbname=mydb
[pgbouncer]
listen_addr = *
listen_port = 6432
# pg_hba.conf file below:
IPv4 local connections:
host all all 0.0.0.0/0 md5
IPv6 local connections:
host all all ::1/128 md5