开发者社区> 问答> 正文

逻辑复制创建订阅报错

【问题描述】 逻辑复制创建订阅报错

发布端: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

展开
收起
kun坤 2019-11-28 10:20:26 595 0
1 条回答
写回答
取消 提交回答
  • 你用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
    
    2019-11-28 10:20:41
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
移动与复制 立即下载
面向失败设计 立即下载
fibjs 模块重构从回调到协程--陈垒 立即下载