我的Postgres复制无法正常运行,请参阅下面的具体错误

问题描述 投票:-1回答:1

我在主/辅配置中设置了两个Postgres数据库。我试图在它们之间设置复制,但是遇到了障碍。我哪里错了?

我检查了各种配置文件:recovery.confpostgresql.confpg_hba.conf,似乎都设置正确。

这是我在pg_log文件夹中发现的错误:

cp: cannot stat ‘/var/lib/pgsql/walfiles/00000002000001CA0000003E’: No such file or directory
cp: cannot stat ‘/var/lib/pgsql/walfiles/00000003.history’: No such file or directory
2019-04-16 16:17:19 AEST  FATAL:  database system identifier differs between the primary and standby
2019-04-16 16:17:19 AEST  DETAIL:  The primary's identifier is 6647133350114885049, the standby's identifier is 6456613398298492847.

我正在使用PostgreSQL 9.2.23。

这是我的recovery.conf

standby_mode = 'on'
primary_conninfo = 'host=10.201.108.25 port=5432 user=repl-master password=111222333'
restore_command = 'cp -p /var/lib/pgsql/walfiles/%f %p'
trigger_file = '/var/lib/pgsql/i_am_master.pg.trigger'
recovery_target_timeline = 'latest'
archive_cleanup_command = 'pg_archivecleanup /var/lib/pgsql/walfiles %r'

我希望从Primary到Secondary复制。到目前为止,没有。

感谢任何意见/想法。

postgresql database-replication postgresql-9.2
1个回答
1
投票

您没有正确设置复制。你不能使用pg_dump来创建副本,你必须使用像pg_basebackup这样的物理备份技术。

有关详细信息,请参阅the documentation

不要使用PostgreSQL 9.2,它是不受支持的。

© www.soinside.com 2019 - 2024. All rights reserved.