数码资讯
如何修复导致“不完整的启动数据包”日志消息尝试在Postgresql中实现复制的问题?
选购提示
关注价格、性能、续航、售后和真实使用场景,理性比较后再下单。
我有两个运行Ubuntu 13.04和PostgreSQL 9.2的云服务器.
我主要使用this blog post来帮助我进行设置.但是,要对从服务器执行初始数据库转储,我使用的是this other blog post中使用的pg_start_backup / pg_stop_backup策略.我已经阅读了文档和postgres wiki.我遇到了几个我能够解决的问题,但我无法通过这个可怜的“数据库启动”失败.
我不确定是否看到:
cp: cannot stat /var/lib/postgresql/9.2/archive/00000001000000000000003A': No such file or directory
达到一致恢复状态后是正常还是出现问题的第一个迹象.我在数据库上进行的搜索正在启动,不完整的启动数据包告诉我正在向从服务器发送空TCP数据包.唯一知道奴隶的事就是主人,所以我不确定为什么要发送空包……
有没有人使用过这个并且知道可能出现什么问题?
postgres登录奴隶看起来像这样:
2013-08-26 13:01:38 CDT LOG: entering standby mode 2013-08-26 13:01:38 CDT LOG: restored log file "000000010000000000000039" from archive 2013-08-26 13:01:38 CDT LOG: incomplete startup packet 2013-08-26 13:01:39 CDT LOG: redo starts at 0/39000020 2013-08-26 13:01:39 CDT LOG: consistent recovery state reached at 0/390000E0 cp: cannot stat '/var/lib/postgresql/9.2/archive/00000001000000000000003A': No such file or directory 2013-08-26 13:01:39 CDT LOG: streaming replication successfully connected to primary 2013-08-26 13:01:39 CDT FATAL: the database system is starting up 2013-08-26 13:01:39 CDT FATAL: the database system is starting up 2013-08-26 13:01:40 CDT FATAL: the database system is starting up 2013-08-26 13:01:40 CDT FATAL: the database system is starting up 2013-08-26 13:01:41 CDT FATAL: the database system is starting up 2013-08-26 13:01:42 CDT FATAL: the database system is starting up 2013-08-26 13:01:42 CDT FATAL: the database system is starting up 2013-08-26 13:01:43 CDT FATAL: the database system is starting up 2013-08-26 13:01:43 CDT FATAL: the database system is starting up 2013-08-26 13:01:44 CDT FATAL: the database system is starting up 2013-08-26 13:01:44 CDT FATAL: the database system is starting up 2013-08-26 13:01:44 CDT LOG: incomplete startup packet 2013-08-26 13:03:27 CDT FATAL: the database system is starting up 2013-08-26 13:03:27 CDT FATAL: the database system is starting up 2013-08-26 13:03:30 CDT FATAL: the database system is starting up 2013-08-26 13:03:30 CDT FATAL: the database system is starting up
谢谢!
布拉德
在9.2及更高版本中,使用pg_basebackup –xlog-method = stream进行一次性复制要容易得多.这会通过复制协议复制事务日志,以及自己的基本备份,并自动处理pg_start_backup和pg_stop_backup.
见the pg_basebackup manual.
标题中提到的“不完整的启动数据包”错误可能是无关的,并且是由尝试从具有sslmode = prefer的客户端与非SSL感知服务器建立SSL连接引起的.
声明:本文内容用于数码产品信息整理与选购参考,具体价格、库存、售后政策以官方渠道和电商页面实时信息为准。