2.2. 升级外部数据库
如果使用外部数据库,请将外部数据库升级到 PostgreSQL 13。另外,您可以将底层操作系统从 Red Hat Enterprise Linux 8 升级到 Red Hat Enterprise Linux 9。
2.2.1. 在外部数据库系统上升级 PostgreSQL
将外部数据库升级到 PostgreSQL 13,并修正了权限。
流程
- 按照在 Red Hat Enterprise Linux 8 部署不同类型的服务器 中的 pg_upgrade 工具中 快速升级中的说明,以升级外部数据库。
更正外部数据库中
evr
扩展的权限:runuser -l postgres -c \ "psql -d foreman -c \"UPDATE pg_extension SET extowner = (SELECT oid FROM pg_authid WHERE rolname='foreman') WHERE extname='evr';\""
# runuser -l postgres -c \ "psql -d foreman -c \"UPDATE pg_extension SET extowner = (SELECT oid FROM pg_authid WHERE rolname='foreman') WHERE extname='evr';\""
Copy to Clipboard Copied!
2.2.2. 升级外部数据库操作系统
另外,您可以使用备份和恢复将外部数据库从 Red Hat Enterprise Linux 8 升级到 Red Hat Enterprise Linux 9。
先决条件
- 一个运行 Red Hat Enterprise Linux 9 for PostgreSQL 服务器的主机,它遵循 Red Hat Enterprise Linux 9 文档中的外部数据库。如需更多信息,请参阅在 Satellite 中使用外部数据库。
流程
- 创建现有外部数据库的备份。
- 在新的 Red Hat Enterprise Linux 9 服务器中恢复备份。
验证 Satellite 能否访问新数据库:
PGPASSWORD='My_Foreman_Database_Password' psql -h postgres.example.com -p 5432 -U foreman -d foreman -c "SELECT 1 as ping"
# PGPASSWORD='My_Foreman_Database_Password' psql -h postgres.example.com -p 5432 -U foreman -d foreman -c "SELECT 1 as ping"
Copy to Clipboard Copied! 如果您的 Satellite 服务器可以使用旧名称访问新的数据库服务器,则不需要进一步的更改。否则,重新配置 Satellite 以使用新名称:
satellite-installer \ --foreman-db-host newpostgres.example.com \ --katello-candlepin-db-host newpostgres.example.com \ --foreman-proxy-content-pulpcore-postgresql-host newpostgres.example.com
# satellite-installer \ --foreman-db-host newpostgres.example.com \ --katello-candlepin-db-host newpostgres.example.com \ --foreman-proxy-content-pulpcore-postgresql-host newpostgres.example.com
Copy to Clipboard Copied!