我有三台服务器,其中两台运行 postgres 9.5.3,第三台运行 pgbouncer 1.7.2。
我可以通过 pgbouncer 访问两个 postgresql 实例之一,一切都很完美。其他 postgresql 服务器,我们称之为 P1 不在我的控制之下,我必须使用 ssl 连接,因此它得到了,因此以下行被添加到该服务器 pga_hba.conf
hostssl all all ###.###.###.###/32 md5
Run Code Online (Sandbox Code Playgroud)
我可以使用 psql 从 pgbouncer 服务器连接到 P1,没有任何问题。但是当我通过 pgbouncer 连接到 P1 时,我收到此错误消息
psql: ERROR: no pg_hba.conf entry for host "XXX.XXX.XXX.XXX", user "myuser", database "mydb", SSL off
Run Code Online (Sandbox Code Playgroud)
这是我的 pgbouncer.ini
[databases]
my_database = host=xxx.xxx.xxx.xxxx port=5432 dbname=mydb user=myuser password=mypassword client_encoding='UTF8'
[pgbouncer]
listen_addr = *
listen_port = 5432
auth_type = md5
auth_file = /etc/pgbouncer/userlist.txt
logfile = /var/log/postgresql/pgbouncer.log
pidfile = /var/run/postgresql/pgbouncer.pid
admin_users = rms_admin
pool_mode …Run Code Online (Sandbox Code Playgroud)