0

我正在按照https://github.com/2ndQuadrant/pglogical的说明在Centos 8上的postgres 12上安装 pglogical 。安装似乎成功:

 yum -y install postgresql12-pglogical
Last metadata expiration check: 0:21:30 ago on Wed 30 Sep 2020 09:32:13 PM CDT.
Dependencies resolved.
=====================================================================================================================================================================================================================================================
 Package                                                      Architecture                                 Version                                                   Repository                                                                 Size
=====================================================================================================================================================================================================================================================
Installing:
 postgresql12-pglogical                                       x86_64                                       2.3.2-1.el8                                               2ndquadrant-dl-default-release-pg12                                       145 k
Installing dependencies:
 postgresql12                                                 x86_64                                       12.4-1PGDG.rhel8                                          pgdg12                                                                    1.6 M
 postgresql12-server                                          x86_64                                       12.4-1PGDG.rhel8                                          pgdg12                                                                    5.2 M

Transaction Summary
=====================================================================================================================================================================================================================================================
Install  3 Packages

Total download size: 7.0 M
Installed size: 29 M
Downloading Packages:
(1/3): postgresql12-12.4-1PGDG.rhel8.x86_64.rpm                                                                                                                                                                      1.5 MB/s | 1.6 MB     00:01
(2/3): postgresql12-pglogical-2.3.2-1.el8.x86_64.rpm                                                                                                                                                                 117 kB/s | 145 kB     00:01
(3/3): postgresql12-server-12.4-1PGDG.rhel8.x86_64.rpm                                                                                                                                                               4.0 MB/s | 5.2 MB     00:01
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                                5.3 MB/s | 7.0 MB     00:01
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                                                                                             1/1
  Installing       : postgresql12-12.4-1PGDG.rhel8.x86_64                                                                                                                                                                                        1/3
  Running scriptlet: postgresql12-12.4-1PGDG.rhel8.x86_64                                                                                                                                                                                        1/3
failed to link /usr/bin/psql -> /etc/alternatives/pgsql-psql: /usr/bin/psql exists and it is not a symlink
failed to link /usr/bin/clusterdb -> /etc/alternatives/pgsql-clusterdb: /usr/bin/clusterdb exists and it is not a symlink
failed to link /usr/bin/createdb -> /etc/alternatives/pgsql-createdb: /usr/bin/createdb exists and it is not a symlink
failed to link /usr/bin/createuser -> /etc/alternatives/pgsql-createuser: /usr/bin/createuser exists and it is not a symlink
failed to link /usr/bin/dropdb -> /etc/alternatives/pgsql-dropdb: /usr/bin/dropdb exists and it is not a symlink
failed to link /usr/bin/dropuser -> /etc/alternatives/pgsql-dropuser: /usr/bin/dropuser exists and it is not a symlink
failed to link /usr/bin/pg_basebackup -> /etc/alternatives/pgsql-pg_basebackup: /usr/bin/pg_basebackup exists and it is not a symlink
failed to link /usr/bin/pg_dump -> /etc/alternatives/pgsql-pg_dump: /usr/bin/pg_dump exists and it is not a symlink
failed to link /usr/bin/pg_dumpall -> /etc/alternatives/pgsql-pg_dumpall: /usr/bin/pg_dumpall exists and it is not a symlink
failed to link /usr/bin/pg_restore -> /etc/alternatives/pgsql-pg_restore: /usr/bin/pg_restore exists and it is not a symlink
failed to link /usr/bin/reindexdb -> /etc/alternatives/pgsql-reindexdb: /usr/bin/reindexdb exists and it is not a symlink
failed to link /usr/bin/vacuumdb -> /etc/alternatives/pgsql-vacuumdb: /usr/bin/vacuumdb exists and it is not a symlink

  Running scriptlet: postgresql12-server-12.4-1PGDG.rhel8.x86_64                                                                                                                                                                                 2/3
  Installing       : postgresql12-server-12.4-1PGDG.rhel8.x86_64                                                                                                                                                                                 2/3
  Running scriptlet: postgresql12-server-12.4-1PGDG.rhel8.x86_64                                                                                                                                                                                 2/3
  Installing       : postgresql12-pglogical-2.3.2-1.el8.x86_64                                                                                                                                                                                   3/3
  Running scriptlet: postgresql12-pglogical-2.3.2-1.el8.x86_64                                                                                                                                                                                   3/3
  Verifying        : postgresql12-pglogical-2.3.2-1.el8.x86_64                                                                                                                                                                                   1/3
  Verifying        : postgresql12-12.4-1PGDG.rhel8.x86_64                                                                                                                                                                                        2/3
  Verifying        : postgresql12-server-12.4-1PGDG.rhel8.x86_64                                                                                                                                                                                 3/3

Installed:
  postgresql12-12.4-1PGDG.rhel8.x86_64                                         postgresql12-pglogical-2.3.2-1.el8.x86_64                                         postgresql12-server-12.4-1PGDG.rhel8.x86_64

Complete!

但是当我尝试重新启动 postgres 时,我收到了这个错误

systemctl restart postgresql
Job for postgresql.service failed because the control process exited with error code.
See "systemctl status postgresql.service" and "journalctl -xe" for details.

journalctl -xe的相关部分

-- Unit postgresql.service has begun starting up.
Sep 30 21:54:59 aba postmaster[305963]: 2020-10-01 02:54:59.825 UTC [305963] FATAL:  could not access file "pglogical": No such file or directory
Sep 30 21:54:59 aba postmaster[305963]: 2020-10-01 02:54:59.825 UTC [305963] LOG:  database system is shut down
Sep 30 21:54:59 aba systemd[1]: postgresql.service: Main process exited, code=exited, status=1/FAILURE
Sep 30 21:54:59 aba systemd[1]: postgresql.service: Failed with result 'exit-code'.
Sep 30 21:54:59 aba systemd[1]: Failed to start PostgreSQL database server.
-- Subject: Unit postgresql.service has failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit postgresql.service has failed.
--
-- The result is failed.

我搞不清楚了!

4

1 回答 1

1

您的会话日志告诉服务器已作为先决条件安装,但“链接”消息暗示已经存在不兼容的客户端版本。可能您已经从 CentOS 软件包中安装了 PostgreSQL,但是 pglogical RPM 被拉入了 PGDG 软件包。

错误消息可能意味着shared_preload_libraries包含pglogical,但在目录pglogical.so中找不到。lib

大概安装过程编辑了旧服务器安装中的配置,但在新服务器中安装了共享对象。

结果:你不能在你的安装中使用那些 pglogical 二进制文件。切换到 PGDG RPM 或从源代码构建 pglogical。

你看我的推论中有一定的猜想,但那应该可以帮助你解决问题。

于 2020-10-02T05:54:08.023 回答