我的 Postgres 复制没有运行,具体错误见下文
My Postgres replication isn't functioning, see below for specific error
我在 Primary/Secondary 配置中设置了两个 Postgres 数据库。我试图在它们之间设置复制,但遇到了障碍。我哪里错了?
我检查了各种配置文件:recovery.conf
、postgresql.conf
、pg_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'
我期望从主节点复制到辅助节点。到目前为止,什么都没有。
感谢任何 input/ideas。
您没有正确设置复制。您不能使用 pg_dump
来创建副本,您必须使用像 pg_basebackup
.
这样的物理备份技术
不要使用 PostgreSQL 9.2,它不受支持。
我在 Primary/Secondary 配置中设置了两个 Postgres 数据库。我试图在它们之间设置复制,但遇到了障碍。我哪里错了?
我检查了各种配置文件:recovery.conf
、postgresql.conf
、pg_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'
我期望从主节点复制到辅助节点。到目前为止,什么都没有。
感谢任何 input/ideas。
您没有正确设置复制。您不能使用 pg_dump
来创建副本,您必须使用像 pg_basebackup
.
不要使用 PostgreSQL 9.2,它不受支持。