登录 pgpool 的 9999 提示 psql: ERROR: MD5 authentication is unsupported in replication and master-slave

版权声明:本文为博主原创文章,转载请标明出处。 https://blog.csdn.net/ctypyb2002/article/details/89217136

os: ubuntu 16.04
db: postgresql 9.6.8
pgpool-ii: 3.7.2

登录 pgpool-ii 的本地 9999 端口时,出现异常

root@node2:/app/pgpool/etc# psql -h 127.0.0.1 -p 9999 -U postgres -d postgres
psql: ERROR:  MD5 authentication is unsupported in replication and master-slave modes.
HINT:  check pg_hba.conf

pool_hba.conf

pool_hba.conf 对本地设置了 trust

# "local" is for Unix domain socket connections only
local   all         all                               trust
# IPv4 local connections:
host    all         all         127.0.0.1/32          trust
# IPv6 local connections:
host    all         all         ::1/128               trust

# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
host    all         all         0.0.0.0/0          md5

pg_hba.conf

# TYPE  DATABASE        USER            ADDRESS                 METHOD
# "local" is for Unix domain socket connections only
local   all              all                                trust
# IPv4 local connections:
host    all              all        127.0.0.1/32            trust
# IPv6 local connections:
host    all              all        ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
host    all              all        0.0.0.0/0               md5

问题就出现了,当在 pgpool 上执行 连接时,对pgpool来说,是 trust.但是分发到目标pgsql时就是具体的ip去连接的.
而pg_hba.conf 的设置为 md5.所以就报错了.
如果不希望报错,可以在 pg_hba.conf 的 0.0.0.0/0 md5 前添加 具体ip的 trust,例如

host    all              all        192.168.56.100/32               trust
host    all              all        192.168.56.101/32               trust
host    all              all        192.168.56.102/32               trust

在这里插入图片描述

参考:
https://blog.csdn.net/dingyingguidyg/article/details/34082561
http://www.pgpool.net/mediawiki/index.php/FAQ

猜你喜欢

转载自blog.csdn.net/ctypyb2002/article/details/89217136