Perform backup and restore operations on Red Hat Satellite Servers and Satellite Capsule Servers, including databases and content stores.
Every Satellite installation requires a tested backup and restore plan.
Recovery procedures must include the Satellite database records and the repository contents.
The satellite-maintain command provides numerous upgrade, backup, content, and health management functions.
[root@satellite ~]# satellite-maintain --help
Usage:
satellite-maintain [OPTIONS] SUBCOMMAND [ARG] ...
Parameters:
SUBCOMMAND subcommand
[ARG] ... subcommand arguments
Subcommands:
health Health related commands
upgrade Upgrade related commands
service Control applicable services
backup Backup server
restore Restore a backup
packages Lock/Unlock package protection, install, update
advanced Advanced tools for server maintenance
content Content related commands
plugin Manage optional plugins on your server
self-upgrade Perform major version self upgrade
maintenance-mode Control maintenance-mode for applicationHaving backups available is an essential part of a disaster recovery plan.
Red Hat Satellite provides the satellite-maintain backup utility to save content externally for later access.
The command has the following syntax:
[root@satellite ~]# satellite-maintain backup {online|offline} target-directoryThe offline and online subcommands determine whether Satellite Server remains available during the backup.
The offline subcommand initiates a cold backup that requires the database to be offline during the backup.
If you perform an offline backup, then Satellite Server is not available for use.
The online subcommand performs a backup during which the Satellite Server remains available.
Avoid most operations on Satellite Server during the backup to ensure that the backup is consistent for later restore.
Any change that affects the Pulp database restarts the backup procedure.
Because the Pulp database backup is the most time-consuming part of the process, Red Hat recommends using online backups only for debugging purposes.
When you run the backup command, Satellite Server automatically creates a subdirectory called satellite-backup- under the provided target directory.
This subdirectory contains the backup files, which you can store offline for future retrieval.YYYY-MM-DD-HH-MM-SS
Before starting the backup, ensure that enough storage is available for the backup to complete. The backup utility compresses the Satellite database information as it is extracted and saved. The Administering Red Hat Satellite Guide provides a detailed method for estimating the required space.
The Pulp content, which is all of the repository software packages that Satellite Server manages, constitutes the largest amount of data that is backed up.
The --skip-pulp-content option excludes the Pulp content when performing the backup.
However, creating and restoring a full system requires backing up the Pulp content; so use the --skip-pulp-content option only for testing and specialized backups.
Backups contain sensitive data, such as SSH keys and SSL certificates. Store backups securely to avoid unauthorized access to hosts that Satellite Server manages.
Full backups can take a long time to run.
The --incremental option initiates a partial backup of Satellite Server with only the changes since an earlier full or incremental backup.
This option requires including an additional directory argument to specify the previous backup directory.
You must perform at least one full backup as a reference before creating incremental backups.
An incremental backup command has the following syntax:
[root@satellite ~]#satellite-maintain backup {online|offline} \--incrementalprevious-backup-dirtarget-directory
You can perform online or offline incremental backups. The restrictions and limitations for the backup subcommand also apply when you perform an incremental backup.
The satellite-maintain restore command restores Satellite Server backup data.
To start a full disaster recovery process, start with a freshly installed Satellite Server.
Previous backups can also be restored onto an existing system, which can overwrite existing data and content.
The hostname and other system configuration should be the same as the original system that was backed up.
The satellite-maintain restore command validates this information, and does not restore backups to a differently named or configured server.
The following command restores from a previous backup:
[root@satellite ~]# satellite-maintain restore backup-directoryWhen restoring incremental backups, follow the complete chronological backup sequence. First, restore the most recent full backup, and then restore each incremental backup in the same order that they were created.
The hammer ping command can be used together with the satellite-maintain service status command to ensure that Satellite is running properly and also used to diagnose and troubleshoot issues with Satellite services.
Use these commands to verify that Satellite is operating properly after a database backup restore.
The hammer ping command returns the status of the Red Hat Satellite core services.
[root@satellite ~]# hammer ping
database:
Status: ok
Server Response: Duration: 0ms
candlepin:
Status: ok
Server Response: Duration: 19ms
candlepin_auth:
Status: ok
Server Response: Duration: 20ms
candlepin_events:
Status: ok
message: 0 Processed, 0 Failed
Server Response: Duration: 0ms
katello_events:
Status: ok
message: 0 Processed, 0 Failed
Server Response: Duration: 0ms
pulp3:
Status: ok
Server Response: Duration: 57ms
pulp3_content:
Status: ok
Server Response: Duration: 53ms
foreman_tasks:
Status: ok
Server Response: Duration: 3msUse the satellite-maintain command to quickly health check the overall status of Satellite operations.
When Satellite is experiencing problems, a health check provides a summary of information.
When Satellite has no issues outstanding, the health check has the following output:
[root@satellite ~]# satellite-maintain health check Running ForemanMaintain::Scenario::FilteredScenario ================================================================================ Check number of fact names in database: [OK] -------------------------------------------------------------------------------- Check whether all services are running: [OK] -------------------------------------------------------------------------------- Check whether all services are running using the ping call: [OK] -------------------------------------------------------------------------------- Check for paused tasks: [OK] -------------------------------------------------------------------------------- Check whether system is self-registered or not: [OK] --------------------------------------------------------------------------------
The satellite-maintain command can query all of Satellite's component systemd services.
The output for each service is the created by a systemctl <service> status command.`
Because Satellite can have dozens of services, the output for the satellite-maintain service status is long.
For this example, the output is omitted after the first service.
[root@satellite ~]# satellite-maintain service status
Running Status Services
================================================================================
Get status of applicable services:
Displaying the following service(s):
redis, postgresql, pulpcore-api, pulpcore-content, pulpcore-worker@1.service, pulpcore-worker@2.service, pulpcore-worker@3.service, pulpcore-worker@4.service, pulpcore-worker@5.service, pulpcore-worker@6.service, pulpcore-worker@7.service, pulpcore-worker@8.service, tomcat, dynflow-sidekiq@orchestrator, foreman, httpd, dynflow-sidekiq@worker-1, dynflow-sidekiq@worker-hosts-queue-1, foreman-proxy
/ displaying redis
● redis.service - Redis persistent key-value database
Loaded: loaded (/usr/lib/systemd/system/redis.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/redis.service.d
└─90-limits.conf
Active: active (running) since Fri 2022-09-23 14:35:37 EDT; 4h 1min ago
Main PID: 1319 (redis-server)
Tasks: 4 (limit: 191021)
Memory: 12.0M
CGroup: /system.slice/redis.service
└─1319 /usr/bin/redis-server 127.0.0.1:6379
...output omitted...For more information, see the Backing Up Satellite Server and Capsule Server chapter in the Administering Red Hat Satellite guide at https://access.redhat.com/documentation/en-us/red_hat_satellite/6.11/html-single/administering_red_hat_satellite/index#Backing_Up_Server_and_Proxy_admin
For more information, see the Restoring Satellite Server or Capsule Server from a Backup chapter in the Administering Red Hat Satellite guide at https://access.redhat.com/documentation/en-us/red_hat_satellite/6.11/html-single/administering_red_hat_satellite/index#Restoring_Server_or_Smart_Proxy_from_a_Backup_admin