5.4. 迁移到外部数据库
备份和传输现有数据,然后使用 satellite-installer
命令将 Satellite 配置为连接到外部 PostgreSQL 数据库服务器。
前提条件
- 您已在 Red Hat Enterprise Linux 服务器中安装和配置了 PostgreSQL 服务器。
流程
在 Satellite 服务器上,停止 Satellite 服务:
satellite-maintain service stop
# satellite-maintain service stop
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 启动 PostgreSQL 服务:
systemctl start postgresql
# systemctl start postgresql
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 备份内部数据库:
satellite-maintain backup online --skip-pulp-content --preserve-directory -y /var/migration_backup
# satellite-maintain backup online --skip-pulp-content --preserve-directory -y /var/migration_backup
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 将数据传送到新的外部数据库:
PGPASSWORD='Foreman_Password' pg_restore -h postgres.example.com -U foreman -d foreman < /var/migration_backup/foreman.dump PGPASSWORD='Candlepin_Password' pg_restore -h postgres.example.com -U candlepin -d candlepin < /var/migration_backup/candlepin.dump PGPASSWORD='Pulpcore_Password' pg_restore -h postgres.example.com -U pulp -d pulpcore < /var/migration_backup/pulpcore.dump
PGPASSWORD='Foreman_Password' pg_restore -h postgres.example.com -U foreman -d foreman < /var/migration_backup/foreman.dump PGPASSWORD='Candlepin_Password' pg_restore -h postgres.example.com -U candlepin -d candlepin < /var/migration_backup/candlepin.dump PGPASSWORD='Pulpcore_Password' pg_restore -h postgres.example.com -U pulp -d pulpcore < /var/migration_backup/pulpcore.dump
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 使用
satellite-installer
命令更新 Satellite 以指向新数据库:Copy to Clipboard Copied! Toggle word wrap Toggle overflow