简体   繁体   English

通过 ssh 隧道设置 pglogical,由对等方重置连接

[英]Setting up pglogical over ssh tunnel, connection reset by peer

I am setting up a pglogical replication between an on-premise PostgreSQL 10.14 (publisher and AWS RDS Postgresql 10.16 (subscriber), but after setting up a subscription, I only get to connection resets. Can anyone spot what I'm doing wrong?我正在内部部署的 PostgreSQL 10.14(发布者和 AWS RDS Postgresql 10.16(订阅者)之间设置 pglogical 复制,但是在设置订阅后,我只能重置连接。谁能发现我做错了什么?

Network setup:网络设置:

On-premise postgres < jumphost > <-- ssh tunnel --> AWS RDS
internal-ip                          10.2.0.8       db01.some.tld

I have verified that the ssh tunnel is working:我已经验证 ssh 隧道正在工作:

  • I can connect to the on-premise postgres from AWS using psql connecting to the tunnel我可以使用连接到隧道的 psql 从 AWS 连接到本地 postgres
  • I can even connect to the on-premise postgres from AWS RDS when using postgres_fwd使用 postgres_fwd 时,我什至可以从 AWS RDS 连接到本地 postgres

Pglogical setup:逻辑设置:
on-premise:现场:

  • create node with dsn host=10.2.0.8 dbname=... user=... password=...使用 dsn host=10.2.0.8 dbname=... user=... password=...创建节点

AWS: AWS:

  • create node with dsn host=db01.some.tld dbname=... user=... password=...使用 dsn host=db01.some.tld dbname=... user=... password=...创建节点
  • create subscription with dsn host=10.2.0.8 dbname=... user=... password=...使用 dsn host=10.2.0.8 dbname=... user=... password=...创建订阅

Once that is done:一旦完成:

  • pglogical processes are running on both the provider and subscriber pglogical 进程同时在提供者和订阅者上运行
  • but I get to the following errors : AWS:但我遇到以下错误:AWS:

LOG: could not receive data from client: Connection reset by peer日志:无法从客户端接收数据:对等方重置连接
LOG: unexpected EOF on client connection with an open transaction日志:客户端连接上的意外 EOF 与打开的事务

On-premise:本地:

LOG: unexpected EOF on client connection with an open transaction日志:客户端连接上的意外 EOF 与打开的事务

I have tried fiddling around with logging parameters, but couldn't get to anything useful.我试过摆弄日志参数,但找不到任何有用的东西。 Similarly I couldn't get anything helpful from the ssh tunnel logs.同样,我无法从 ssh 隧道日志中获得任何有用的信息。

Any idea what I could be doing wrong?知道我可能做错了什么吗?

Figured it out.弄清楚了。 In this case:在这种情况下:

The connection was fine.连接很好。 However, there was an issue with the schema of one table on the replica, causing the replication to die.但是,副本上的一个表的架构存在问题,导致复制终止。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM