이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 18. Backup and Disaster Recovery


This chapter describes the minimum and typical backup and restore procedures required to ensure continuity of your Red Hat Satellite deployment and associated data in the event of a disaster. If your deployment uses custom configurations you should take these into account when planning your backup and disaster recovery policy.

18.1. Backing up Red Hat Satellite

This section describes how to prepare and back up your Red Hat Satellite Server to facilitate recovery in the event of disaster. This example uses the /backup directory as the target directory for backup archives, and is described in several parts:
  • Preparing the backup location and backing up configuration and data files
  • Backing up the repositories
  • Backing up the databases
  • Verifying the backup

Note

If SELinux is enabled and in enforcing mode, ensure that any local content requiring synchronization is labeled with "httpd_sys_content_t".

Procedure 18.1. To Prepare the Backup Location and Back up Configuration and Data Files:

  1. Prepare your backup location:
    # umask 0027
    # export BDIR=/backup
    # mkdir $BDIR
    # chgrp postgres $BDIR
    # chmod 770 $BDIR
    # cd $BDIR
    
    Copy to Clipboard Toggle word wrap
  2. Back up the configuration and data files:
    # tar --selinux -czvf config_files.tar.gz \
    /etc/katello \
    /etc/elasticsearch \
    /etc/candlepin \
    /etc/pulp \
    /etc/pki/katello \
    /etc/pki/pulp \
    /etc/qpidd.conf \
    /etc/sysconfig/katello \
    /etc/sysconfig/elasticsearch \
    /root/ssl-build \
    /var/www/html/pub/*
    
    # tar --selinux -czvf elastic_data.tar.gz /var/lib/elasticsearch
    Copy to Clipboard Toggle word wrap
Backing up Satellite Repositories

The RPM files in repositories already use compression and cannot be compressed any further. Therefore, depending on instance size, the resulting backup archive (pulp_data.tar) can grow quite large. Ensure you have sufficient space to store the resulting file.

There are two options for backing up repositories: online backup; and offline backup.

Procedure 18.2. To Perform an Online Repository Backup:

  • Run the following commands to perform a checksum of all time stamps, back up the repository, and perform the checksum again.
    # find /var/lib/pulp -printf '%T@\n' | md5sum
    # tar --selinux -cvf pulp_data.tar /var/lib/pulp /var/www/pub
    # find /var/lib/pulp -printf '%T@\n' | md5sum
    Copy to Clipboard Toggle word wrap
    If the checksums match, the online backup is correct and usable. If the checksums do not match, perform the repository backup again.

    Note

    You can use the rsync command to speed up file copying. This can help to ensure the checksums match.

Procedure 18.3. To Perform an Offline Repository Backup:

  • Run the following commands to stop the required services, perform the backup, and restart the services:
    # katello-service stop
    # tar --selinux -cvf pulp_data.tar /var/lib/pulp /var/www/pub
    # katello-service start
    Copy to Clipboard Toggle word wrap

    Note

    While the katello-service is stopped, Red Hat Satellite and the yum clients will be unable to maintain a connection. Any repository actions performed on Red Hat Satellite will fail during this period.
Backing up the Databases

You can perform either online or offline database backups. You do not need to do both. Offline backups require that the Satellite Server be completely inactive.

Warning

Red Hat Satellite must be completely inactive to do an offline backup. Following this procedure while Satellite is running may result in corrupted data.
This method archives all data from the PostgreSQL and MongoDB databases. Red Hat recommends that you perform this backup during maintenance periods.

Procedure 18.4. To Perform a Complete Offline Database Backup:

  1. Ensure the Satellite Server is completely stopped:
    # katello-service stop
    Copy to Clipboard Toggle word wrap
  2. Run the following commands to back up the PostgreSQL and MongoDB databases:
    # tar --selinux -czvf mongo_data.tar.gz /var/lib/mongodb
    # tar --selinux -czvf pgsql_data.tar.gz /var/lib/pgsql/data/
    
    Copy to Clipboard Toggle word wrap
  3. Restart the required services:
    # katello-service start
    Copy to Clipboard Toggle word wrap
Performing Online Database Backups

If you prefer, you can perform separate online backups of your databases. This is not necessary if you have performed complete offline backups.

Procedure 18.5. To Perform an Online Backup of the PostgreSQL Database:

  1. Determine the name of the Red Hat Satellite PostgreSQL database. The default name is foreman and is specified in the /usr/share/katello-installer/modules/foreman/manifests/database/postgresql.pp file. If you chose a different name for your database, it is stored as the value of db_database in the /etc/katello-installer/answers.katello-installer.yaml file.

    Note

    If you used the default database name, this variable has no value in the answers.katello-installer.yaml file.
    The Candlepin database name, candlepin, is not currently user configurable. It is specified in the /usr/share/katello-installer/modules/candlepin/manifests/init.pp file.
  2. Run the following commands to create online database backups. It is not necessary to stop PostgreSQL or Red Hat Satellite, and this process does not block logged-in users. However, the process can take several minutes to finish depending on database sizes.
    # runuser - postgres -c "pg_dump -Fc foreman > /backup/foreman.dump"
    # runuser - postgres -c "pg_dump -Fc candlepin > /backup/candlepin.dump"
    Copy to Clipboard Toggle word wrap

Procedure 18.6. To Perform an Online Backup of the MongoDB Database:

  • Run the following command in the /backup directory to create the /backup/mongo_dump/pulp_database directory, including JSON files.
    # mongodump --host localhost --out $BDIR/mongo_dump
    Copy to Clipboard Toggle word wrap
Verifying Your Backups

It is important to verify the results of your backups. The process creates the following archive files and directory:

# ls $BDIR
candlepin.dump
config_files.tar.gz
elastic_data.tar.gz
foreman.dump
mongo_dump/
pulp_data.tar
Copy to Clipboard Toggle word wrap
If you performed the optional offline backup of the databases, the following files also appear:
mongo_data.tar.gz
pgsql_data.tar.gz
Copy to Clipboard Toggle word wrap
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat