首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >逻辑工作人员复制说发布不存在,但是这似乎确实存在吗?

逻辑工作人员复制说发布不存在,但是这似乎确实存在吗?
EN

Database Administration用户
提问于 2020-10-20 18:22:02
回答 1查看 1.4K关注 0票数 0

我正在尝试在两个数据库实例之间设置逻辑复制。

我在主数据库上创建了一个发布,在副本上创建了一个订阅。具体地说:

在主数据库上:

代码语言:javascript
运行
复制
create publication chris for all tables; 

关于副本db:

代码语言:javascript
运行
复制
CREATE SUBSCRIPTION chris
    CONNECTION 'host=localhost port=5540 dbname=finder connect_timeout=10'
    PUBLICATION chris;

但是,由于某些原因,副本似乎没有识别发布(本质上是ERROR: could not receive data from WAL stream: ERROR: publication "chris" does not exist) (来自副本的日志):

代码语言:javascript
运行
复制
Oct 20 18:18:31 test2 8y7qb8wz8ps875yrvpmg9c1zsffls4hy-unit-script-postgresql-start[289]: 2020-10-20 18:18:31.013 GMT [289] LOG:  background worker "logical replication worker" (PID 3035) exited with exit code 1
Oct 20 18:18:36 test2 8y7qb8wz8ps875yrvpmg9c1zsffls4hy-unit-script-postgresql-start[289]: 2020-10-20 18:18:36.020 GMT [3036] LOG:  logical replication apply worker for subscription "chris" has started
Oct 20 18:18:36 test2 8y7qb8wz8ps875yrvpmg9c1zsffls4hy-unit-script-postgresql-start[289]: 2020-10-20 18:18:36.022 GMT [3036] ERROR:  could not receive data from WAL stream: ERROR:  publication "chris" does not exist
Oct 20 18:18:36 test2 8y7qb8wz8ps875yrvpmg9c1zsffls4hy-unit-script-postgresql-start[289]:         CONTEXT:  slot "chris", output plugin "pgoutput", in the change callback, associated LSN 0/6BA6EC8
Oct 20 18:18:36 test2 8y7qb8wz8ps875yrvpmg9c1zsffls4hy-unit-script-postgresql-start[289]: 2020-10-20 18:18:36.023 GMT [289] LOG:  background worker "logical replication worker" (PID 3036) exited with exit code 1
Oct 20 18:18:41 test2 8y7qb8wz8ps875yrvpmg9c1zsffls4hy-unit-script-postgresql-start[289]: 2020-10-20 18:18:41.030 GMT [3039] LOG:  logical replication apply worker for subscription "chris" has started
Oct 20 18:18:41 test2 8y7qb8wz8ps875yrvpmg9c1zsffls4hy-unit-script-postgresql-start[289]: 2020-10-20 18:18:41.033 GMT [3039] ERROR:  could not receive data from WAL stream: ERROR:  publication "chris" does not exist
Oct 20 18:18:41 test2 8y7qb8wz8ps875yrvpmg9c1zsffls4hy-unit-script-postgresql-start[289]:         CONTEXT:  slot "chris", output plugin "pgoutput", in the change callback, associated LSN 0/6BA6EC8
Oct 20 18:18:41 test2 8y7qb8wz8ps875yrvpmg9c1zsffls4hy-unit-script-postgresql-start[289]: 2020-10-20 18:18:41.034 GMT [289] LOG:  background worker "logical replication worker" (PID 3039) exited with exit code 1

奇怪的是,主数据库的日志似乎也显示了相同的错误(ERROR: publication "chris" does not exist):

代码语言:javascript
运行
复制
Oct 20 18:22:56 pgtestpublic 22rj0nr8pn1k0r3q8q6pxixp6hn2zi4i-unit-script-postgresql-start[260]: 2020-10-20 18:22:56.545 GMT [514] CONTEXT:  slot "chris", output plugin "pgoutput", in the change callback, associated LSN >
Oct 20 18:23:01 pgtestpublic 22rj0nr8pn1k0r3q8q6pxixp6hn2zi4i-unit-script-postgresql-start[260]: 2020-10-20 18:23:01.555 GMT [515] LOG:  starting logical decoding for slot "chris"
Oct 20 18:23:01 pgtestpublic 22rj0nr8pn1k0r3q8q6pxixp6hn2zi4i-unit-script-postgresql-start[260]: 2020-10-20 18:23:01.555 GMT [515] DETAIL:  Streaming transactions committing after 0/6BA6E60, reading WAL from 0/6BA6E28.
Oct 20 18:23:01 pgtestpublic 22rj0nr8pn1k0r3q8q6pxixp6hn2zi4i-unit-script-postgresql-start[260]: 2020-10-20 18:23:01.555 GMT [515] LOG:  logical decoding found consistent point at 0/6BA6E28
Oct 20 18:23:01 pgtestpublic 22rj0nr8pn1k0r3q8q6pxixp6hn2zi4i-unit-script-postgresql-start[260]: 2020-10-20 18:23:01.555 GMT [515] DETAIL:  There are no running transactions.
Oct 20 18:23:01 pgtestpublic 22rj0nr8pn1k0r3q8q6pxixp6hn2zi4i-unit-script-postgresql-start[260]: 2020-10-20 18:23:01.556 GMT [515] ERROR:  publication "chris" does not exist
Oct 20 18:23:01 pgtestpublic 22rj0nr8pn1k0r3q8q6pxixp6hn2zi4i-unit-script-postgresql-start[260]: 2020-10-20 18:23:01.556 GMT [515] CONTEXT:  slot "chris", output plugin "pgoutput", in the change callback, associated LSN >
Oct 20 18:23:06 pgtestpublic 22rj0nr8pn1k0r3q8q6pxixp6hn2zi4i-unit-script-postgresql-start[260]: 2020-10-20 18:23:06.566 GMT [518] LOG:  starting logical decoding for slot "chris"
Oct 20 18:23:06 pgtestpublic 22rj0nr8pn1k0r3q8q6pxixp6hn2zi4i-unit-script-postgresql-start[260]: 2020-10-20 18:23:06.566 GMT [518] DETAIL:  Streaming transactions committing after 0/6BA6E60, reading WAL from 0/6BA6E28.
Oct 20 18:23:06 pgtestpublic 22rj0nr8pn1k0r3q8q6pxixp6hn2zi4i-unit-script-postgresql-start[260]: 2020-10-20 18:23:06.566 GMT [518] LOG:  logical decoding found consistent point at 0/6BA6E28

但是,我确实看到了正确的预期输出:

代码语言:javascript
运行
复制
select * from pg_catalog.pg_publication;
select * from pg_catalog.pg_publication;

在主数据库上。

我能进一步调查什么?错误的原因可能是什么呢?

EN

回答 1

Database Administration用户

回答已采纳

发布于 2020-10-22 16:26:08

我完全忘了指定用户名和密码。在默认情况下,它可能使用了一些默认的用户/密码组合。否则,可能是一条误导性错误信息。

代码语言:javascript
运行
复制
CREATE SUBSCRIPTION chris
    CONNECTION 'host=localhost username=example password=example port=5540 dbname=finder connect_timeout=10'
    PUBLICATION chris;
票数 0
EN
页面原文内容由Database Administration提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://dba.stackexchange.com/questions/278393

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档