postgresql - Postgresql 复制意外停止 从属服务器的服务未启动。如何恢复复制?
问题描述
Postgres 复制在 Postgresql 9.5 版中运行良好。当创建了具有 10gb 数据的 DB 模板然后从服务器停止时。它的 Postgres 服务现在还没有启动。你能建议如何重新配置复制吗?我曾尝试重新安装并执行相同的复制过程,但在从主服务器复制数据文件夹后,服务没有运行,除了 conf 文件。这些是我遵循的步骤: 在大师中:-
*C:\Programfiles\PostgreSql\9.5\data\postgresql.conf
Modifications:
listen_addresses = '*'
wal_level = hot_standby
max_wal_senders = 1
wal_keep_segments = 5
* C:\Programfiles\PostgreSql\9.5\data\pg_hba.conf
Add:
host replication postgres x.x.x.x/32 trust
在奴隶:
'*C:\Programfiles\PostgreSql\9.5\data\postgresql.conf'
'hot_standby = on'
然后在路径下创建一个名为recovery.conf的文件
‘C:\Programfiles\PostgreSql\9.5\data\’ and add:'
'standby_mode = 'on'
'primary_conninfo = 'host=x.x.x.x port=5432 user=postgres'
'password=*****''
'trigger_file = 'E:\replication\trigger.txt'
在 Master 中:启动 Postgresql 服务。打开 Sql Shell(psql) 输入命令
select pg_start_backup('base backup');
然后将除postmaster.pid之外的数据目录的所有内容,以及所有配置文件(.conf)复制到Slave系统的数据目录下,输入命令
select pg_stop_backup();
请提出一种恢复此复制的方法。
这是错误日志
2018-07-30 15:26:57 +04 FATAL: the database system is starting up
2018-07-30 15:26:57 +04 LOG: database system was interrupted while in
recovery at log time 2018-07-07 12:21:38 +04
2018-07-30 15:26:57 +04 HINT: If this has occurred more than once some data
might be corrupted and you might need to choose an earlier recovery target.
2018-07-30 15:26:58 +04 FATAL: the database system is starting up
2018-07-30 15:26:59 +04 FATAL: the database system is starting up
2018-07-30 15:27:00 +04 FATAL: the database system is starting up
2018-07-30 15:27:00 +04 LOG: entering standby mode
2018-07-30 15:27:00 +04 LOG: redo starts at 6F/5B387B70
2018-07-30 15:27:01 +04 LOG: consistent recovery state reached at
6F/5BD384F0
2018-07-30 15:27:01 +04 WARNING: page 4 of relation base/16394/27254 does
not exist
2018-07-30 15:27:01 +04 CONTEXT: xlog redo Heap2/VISIBLE: cutoff xid 0
2018-07-30 15:27:01 +04 PANIC: WAL contains references to invalid pages
2018-07-30 15:27:01 +04 CONTEXT: xlog redo Heap2/VISIBLE: cutoff xid 0
2018-07-30 15:27:01 +04 LOG: database system is ready to accept read only
connections
2018-07-30 15:27:01 +04 FATAL: role "WIN-6QQN9PM6AUG$" does not exist
2018-07-30 15:27:01 +04 LOG: startup process (PID 2808) was terminated by
exception 0xC0000409
2018-07-30 15:27:01 +04 HINT: See C include file "ntstatus.h" for a
description of the hexadecimal value.
2018-07-30 15:27:01 +04 LOG: terminating any other active server processes
解决方案
推荐阅读
- c# - 过滤 GetTypes() 以删除使用异步方法从部分类创建的额外类型
- c# - 如何抛出反序列化的异常?
- qt - Qml chartview 绘制具有 4000 个值的条形系列 Xaxis 值被三个(...)省略,因为数据更多的是 chartview 被压缩
- azure - 读取 pyspark 中的多个文件并将其合并
- kubernetes - HELM 准入在“Container Creating”状态下不断创建 Pod
- parsing - 用于解析的帧的 Lua 长度
- c# - System.DllNotFoundException:libpcsclite.so.1 程序集:
类型: 成员:(空) - scala - Gatling Simulation 中的发布请求正文中的时间戳
- python - 计算维特比的转移概率矩阵
- python - 为什么 Jupyter 中的一些 shell 命令不需要感叹号?