为什么Postgres DUMP数据数据库连接丢失在Amazon RDS上?

时间:2021-10-13 07:29:37

I am having Postgres database dump file of 150 GB on Amazon EC2 instance. While dumping the data on RDS from EC2 server I am getting error.

我在Amazon EC2实例上拥有150 GB的Postgres数据库转储文件。在从EC2服务器上将数据转储到RDS时,我收到错误。

The output of the command is as given below. It's giving error

命令的输出如下所示。它给出了错误

1. psql connection not open    
2. connection to server was lost 
on RDS dump postgres copy command

Command Output:
SET
SET
SET
SET
SET
SET
SET
SET
ALTER TABLE
ALTER TABLE
ALTER SEQUENCE
ALTER TABLE
psql:filename.sql:1396266: connection not open
psql:filename.sql:1396266: connection to server was lost

Application Configuration:

Ruby 1.9.3 
Rails 3
PostgreSQL 9.3

Please help why it is breaking while copying the data. As the connection was established and command is running. Suddenly while executing the copy command it is breaking.

请在复制数据时帮助解决它的原因。建立连接并且命令正在运行。突然执行复制命令时,它正在破坏。

Update Findings

Command/script that I am using to dump data the data is below:

我用来转储数据的命令/脚本如下:

psql -h instance.id.region-2.rds.amazonaws.com -p 5432 -U username -W -d database_name -f filename.sql

Workaround for finding issues as below:

找到问题的解决方法如下:

I took head 100 rows and tail 200 rows and made 1 file from the big 150 GB file it converted to 56KB. when I run this command, it's dumped successfully.

我把头100行和尾200行,从150 GB的大文件中制作了1个文件,转换为56KB。当我运行此命令时,它被成功转储。

So the file size is causing problem. The same command is running for small size file for dumping data on RDS.

所以文件大小导致问题。为小型文件运行相同的命令以在RDS上转储数据。

How can I resolve this issue?

我该如何解决这个问题?

1 个解决方案

#1


0  

I think your connect it's disconnect in tcp connection level. these is any limit in your env from your client to RDS? like netflow control, idle session kill and so on...

我认为你连接它在tcp连接级别断开连接。这些是您的客户对RDS的环境限制吗?像netflow控制,空闲会话杀死等...

#1


0  

I think your connect it's disconnect in tcp connection level. these is any limit in your env from your client to RDS? like netflow control, idle session kill and so on...

我认为你连接它在tcp连接级别断开连接。这些是您的客户对RDS的环境限制吗?像netflow控制,空闲会话杀死等...