Mik*_*ika 5 postgresql replication postgresql-9.5
我正在使用 Pglogic 和 Postgresql v9.5 测试逻辑复制。
简单的配置似乎还可以。它的意思是:
但是,订阅包含特定模式中的表的新replication_set 不起作用。
该命令通过(在提供者节点中):
select pglogical.replication_set_add_all_tables(
set_name := 'new_replication_set',
schema_names := '{myschema}',
synchronize_data := 'true'
);
Run Code Online (Sandbox Code Playgroud)
该命令通过(在订阅者节点中):
select pglogical.create_subscription(
subscription_name := 'subscription',
replication_sets := array['new_replication_set'],
provider_dsn := 'host=10.20.30.40 port=6432 dbname=production user=pglogical_prod',
synchronize_data := 'true'
);
Run Code Online (Sandbox Code Playgroud)
但订阅者节点中的表是空的。
我错过了什么吗?感谢致敬。
附加信息:
select pglogical.alter_subscription_synchronize(...)
并select pglogical.alter_subscription_resynchronize_table(...)
发出命令,
订阅者节点中的表也处于特定模式中,
select * from pglogical.queue;
请求不为空。
下面是从订阅者节点获取的日志消息:
我在订阅者节点中设置了 log_min_message = debug5 。
下面是错误消息:
792 < 2018-03-14 11:38:56.449 CET >LOG: starting apply for subscription subscription
793 < 2018-03-14 11:38:56.449 CET >DEBUG: StartTransaction
794 < 2018-03-14 11:38:56.449 CET >DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1 /0, nestlvl: 1, children:
795 < 2018-03-14 11:38:56.449 CET >DEBUG: CommitTransaction
796 < 2018-03-14 11:38:56.449 CET >DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1 /0, nestlvl: 1, children:
797 < 2018-03-14 11:38:56.449 CET >ERROR: subscriber subscription initialization failed during nonrecoverable step (d) , please try the setup again
798 < 2018-03-14 11:38:56.449 CET >DEBUG: shmem_exit(1): 2 before_shmem_exit callbacks to make
799 < 2018-03-14 11:38:56.449 CET >LOG: apply worker [16870] at slot 1 generation 4 exiting with error
800 < 2018-03-14 11:38:56.449 CET >DEBUG: shmem_exit(1): 6 on_shmem_exit callbacks to make
801 < 2018-03-14 11:38:56.449 CET >DEBUG: proc_exit(1): 2 callbacks to make
802 < 2018-03-14 11:38:56.449 CET >DEBUG: exit(1)
803 < 2018-03-14 11:38:56.449 CET >DEBUG: shmem_exit(-1): 0 before_shmem_exit callbacks to make
804 < 2018-03-14 11:38:56.449 CET >DEBUG: shmem_exit(-1): 0 on_shmem_exit callbacks to make
805 < 2018-03-14 11:38:56.449 CET >DEBUG: proc_exit(-1): 0 callbacks to make
806 < 2018-03-14 11:38:56.450 CET >DEBUG: reaping dead processes
807 < 2018-03-14 11:38:56.450 CET >LOG: worker process: pglogical apply 16385:2875150205 (PID 16870) exited with exit code 1
Run Code Online (Sandbox Code Playgroud)
感谢致敬。
订阅者节点中的表和模式名称必须与提供者节点相同。如果两个节点之间的名称不同,则会出现以下错误消息:
>LOG: starting apply for subscription subscription
>INFO: initializing subscriber subscription
>INFO: synchronizing data
>ERROR: schema "myschema" does not exist
>LOG: starting apply for subscription subscription
>INFO: initializing subscriber subscription
>INFO: synchronizing data
>ERROR: relation "myschema.tblprod2" does not exist
Run Code Online (Sandbox Code Playgroud)
现在复制工作正常。