Postgresql复制意外停止从服务器的服务未启动。如何恢复复制?

时间:2018-08-01 14:03:53

标签: postgresql database-replication postgresql-9.5

Postgres Replication在Postgresql 9.5版中正常工作。 创建具有10gb数据的数据库模板,然后从属服务器停止时。它的Postgres服务现在还没有启动。您能建议如何重新配置​​复制吗? 我尝试重新安装并执行相同的复制步骤,但是从主服务器复制数据文件夹(conf文件除外)后,该服务未运行。 这些是我遵循的步骤: 在Master中:-

*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'    

在大师中:   启动Postgresql服务。     打开Sql Shell(psql)键入命令

select pg_start_backup('base backup');

然后将数据目录中的所有内容(不包括postmaster.pid)和所有配置文件(.conf)复制到从系统的数据目录中 现在输入命令

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

0 个答案:

没有答案