第 2 章 Restoring from a backup
You can restore Red Hat Advanced Cluster Security for Kubernetes (RHACS) from an existing backup by using the roxctl command-line interface (CLI).
Depending upon your requirements and the data you have backed up, you can restore from the following types of backups:
- Restore an external PostgreSQL database: Use this to restore your RHACS instance when you use an external PostgreSQL database. You can recover your system data while maintaining your existing database setup.
- Restore the Central certificates and redeploy Central: Use this to restore the Central certificates and redeploy Central after a database restoration. This ensures that authentication certificates for secured clusters and API tokens remain valid.
- Restore Central database from the Central database backup: Use this to recover from a database failure or data corruption event. You can restore and recover the Central database to its earlier functional state.
- Restore Central from the Central deployment backup: Use this if you are migrating Central to another cluster or namespace. This option restores the configurations of your Central installation.
2.1. Restoring an external PostgreSQL database 复制链接链接已复制到粘贴板!
By restoring an external PostgreSQL database, you can recover your Red Hat Advanced Cluster Security for Kubernetes (RHACS) instance from a backup while maintaining your existing database setup.
This procedure focuses on restoring the database that contains your RHACS system data. You can perform a PostgreSQL database restore by using the vendor-recommended pg_restore command.
Prerequisites
-
You have scaled down Central to
0.
Procedure
To perform a PostgreSQL restore, run the following command:
$ pg_restore -U <username> -d <database_name> <path_to_backup_file>where:
<username>- Specifies the actual user name.
<database_name>- Specifies the name of the target database.
<path_to_backup_file>-
Specifies the location and name of the file you want to restore. You can use
.tar,.gz, or another custom file format.
After you restore the external PostgreSQL database, you must restore the RHACS Central certificates.