【问题描述】 逻辑复制创建订阅报错
发布端:10.47.231.30
订阅端:10.47.231.96
--发布端已经在pg_hba.conf上配置trust的复制链路 host replication all 10.47.231.96/32 trust --通过psql可以在96上正常连接30,如下: postgres@host-10-47-231-96:~> psql -h 10.47.231.30 -U postgres -d zxin psql (9.6.4) Type "help" for help.
-- 发布端已经配置好pglogical,并创建好了节点、以及发布的表
-- 订阅端创配置好pglogical,创建好节点,然后再创建订阅时报错: pgx=# SELECT pglogical.createsubscription( subscriptionname := 'subscription2', providerdsn := 'host=10.47.231.30 port=6789 dbname=pgx' ); ERROR: could not connect to the postgresql server: fesendauth: no password supplied DETAIL: dsn was: host=10.47.231.96 port=6789 dbname=pgx
问题是:已经在发布端放开了订阅端的访问限制,为什么在订阅端创建订阅时还会报需要密码的错误; 我甚至还增加了 user和password的属性还是报一样的错误
pgx=# SELECT pglogical.createsubscription( subscriptionname := 'subscription2', providerdsn := 'host=10.47.231.30 port=6789 dbname=pgx password=123456' ); ERROR: could not connect to the postgresql server: fesendauth: no password supplied DETAIL: dsn was: host=10.47.231.96 port=6789 dbname=pgx
你用pglogical插件,是因为这个插件的功能比pg原生自带的逻辑复制功能更多吧? 我用的是pg集成进去的逻辑复制功能;不知道你用过没有,但是郁闷的是有个问题,配置很简单,就是没有效果:
Why do I configure logical replication steps and states correctly, but records that exist before tables on the main library and newly inserted records do not appear in the standby library? Why? Cloud=# SELECT * FROM pgstatsubscription;
[RECORD 1] - - + - -- SubID 16838 Subname testsub PID 8050 Relid Receivedlsn 0/18C61B0 Lastmsgsendtime 2018-09-16 09:11:07.829583+08 Lastmsgreceipttime 2018-09-16 09:11:07.830084+08 Latestendlsn 0/18C61B0 Latestendtime 2018-09-16 09:11:07.829583+08 The replication status of the main library: Postgres=# SELECT * FROM pgstat_replication;
[RECORD 1] - + - -- PID 8162 Usesysid 10 Usename Postgres Applicationname testsubx Clientaddr 192.168.0.39 Clienthostname Clientport 42597 Backendstart 2018-09-16 09:09:54.933629+08 Backendxmin State streaming Sentlsn 0/18C6290 Writelsn 0/18C6290 Flushlsn 0/18C6290 Replaylsn 0/18C6290 Writelag Flushlag Replaylag Syncpriority 0 Sync_state Async
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。