由于软件包损坏,postgres-xc 将无法安装

Jer*_*ome 2 apt postgresql 14.04

在 14.04 安装时,postgresql 是通过安装 sudo apt-get install postgresql postgresql-contrib libpq-dev

此安装旨在成为从属设备,但如果不运行 pg_resetxlog,则无法启动。即使/usr/lib/postgresql/9.3/bin/有 pg_resetxlog,系统也需要安装“postgres-xc”。

apt-get install postgres-xc
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 postgres-xc : Depends: postgres-xc-client but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)

如果 postgres-xc 依赖于 postgres-xc-client,为什么这个依赖被忽略了?

Update Slave 是一个 VPS。已安装通过sudo apt-get install postgresql postgresql-contrib libpq-dev
在主机上创建 postgresql (OS X 10.6.8,通过自制软件安装 postgre)

psql -c "select pg_start_backup('initial_backup');"
rsync -cva --inplace --exclude=*pg_xlog* /usr/local/var/postgres/ slave_IP_address:/var/lib/postgresql/9.3/main/
psql -c "select pg_stop_backup();"
Run Code Online (Sandbox Code Playgroud)

然后从站创建了它的 recovery.conf 文件。但是从服务器的service postgresql start启动开始阻塞 pg_log 被排除在外,然后创建了该目录。
然后: PANIC: could not locate a valid checkpoint record

Cra*_*ger 8

您复制了基本备份而没有pg_xlog- 显然是故意的。

这是确定的唯一的一次是当你的主机具有archive_command在其postgresql.conf存档WAL一些共享位置,和副本具有restore_command在其recovery.conf可读取存档的WAL。即便如此,您也必须mkdir将空的pg_xlog.

如果您不使用 WAL 归档,则必须复制pg_xlog,包括在 结束创建的 WAL 段pg_stop_backup,如手册中所述。

我强烈建议您使用较新的pg_basebackup命令来制作副本。正确处理要简单得多。简单地replication从主服务器上的计划副本地址启用连接(在`pg_hba.conf 中),就像您将用于流式复制一样,然后:

pg_basebackup -D /path/to/new/data/dir -X stream --write-recovery-conf -h master.server.address ...other connection options...
Run Code Online (Sandbox Code Playgroud)

将 master 的数据目录(包括所有必需的 WAL)复制到副本。它甚至会recovery.conf自动为您创建一个。


postgres-xc不是一回事PostgreSQL的。它是旧版本 PostgreSQL 的不兼容分支,它添加了多主集群。如果 Ubuntu 告诉您安装postgres-xc以获得 PostgreSQL 工具,这是一个严重的错误。

永远不要跑pg_resetxlog。唯一应该发生在严重的数据库故障之后,并且只有在完全备份之后;请参阅wiki上有关数据库损坏的条目。