Search

Chapter 11. Maintaining Satellite Server

download PDF

This chapter provides information on how to maintain a Red Hat Satellite Server, including information on how to work with audit records, how to clean unused tasks, how to recover Pulp from a full disc, how to reclaim disc space from NongoDB, and how to use Red Hat Insights to proactively diagnose systems.

11.1. Deleting Audit Records

Audit records are created automatically in Satellite. You can use the foreman-rake audits:expire command to remove audits at any time. You can also use a cron job to schedule audit record deletions at the set interval that you want.

By default, using the foreman-rake audits:expire command removes audit records that are older than 90 days. You can specify the number of days to keep the audit records by adding the days option and add the number of days.

For example, if you want to delete audit records that are older than seven days, enter the following command:

# foreman-rake audits:expire days=7

11.2. Anonymizing Audit Records

You can use the foreman-rake audits:anonymize command to remove any user account or IP information while maintaining the audit records in the database. You can also use a cron job to schedule anonymizing the audit records at the set interval that you want.

By default, using the foreman-rake audits:anonymize command anonymizes audit records that are older than 90 days. You can specify the number of days to keep the audit records by adding the days option and add the number of days.

For example, if you want to anonymize audit records that are older than seven days, enter the following command:

# foreman-rake audits:anonymize days=7

11.3. Cleaning Unused Tasks

Cleaning unused tasks reduces disk space in the database and limits the rate of disk growth. When you perform regular cleaning, Satellite backup completes faster and overall performance is higher.

To clean unused tasks

The installer has a feature to enable a cron job to automatically remove old tasks. This feature is not enabled by default to avoid unwanted tasks cleanup.

  1. Enable the cron job:

    # satellite-installer --foreman-plugin-tasks-automatic-cleanup true
  2. By default, the cron job is scheduled to run every day at 19:45. To adjust to the time, change the value of the --foreman-plugin-tasks-cron-line parameter:

    # satellite-installer --foreman-plugin-tasks-cron-line "00 15 * * *"

    The previous command schedules the cron job to run every day at 15:00, see man 5 crontab for more details on cron format.

To change the period after which to delete all the tasks and to configure further advanced settings of the cron job, change the content of the /etc/foreman/plugins/foreman-tasks.yaml file.

11.4. Recovering from a Full Disk

The following procedure describes how to resolve the situation when a logical volume (LV) with the Pulp database on it has no free space.

To recover from a full disk

  1. Let running Pulp tasks finish but do not trigger any new ones as they can fail due to the full disk.
  2. Ensure that the LV with the /var/lib/pulp directory on it has sufficient free space. Here are some ways to achieve that:

    1. Remove orphaned content:

      # foreman-rake katello:delete_orphaned_content RAILS_ENV=production

      This is run weekly so it will not free much space.

    2. Change the download policy from Immediate to On Demand for as many repositories as possible and remove already downloaded packages. See the Red Hat Knowledgebase solution How to change syncing policy for Repositories on Satellite 6.2 from "Immediate" to "On-Demand" on the Red Hat Customer Portal for instructions.
    3. Grow the file system on the LV with the /var/lib/pulp directory on it. For more information, see Growing a File System on a Logical Volume in the Red Hat Enterprise Linux 7 Logical Volume Manager Administration Guide.

      Note

      If you use an untypical file system (other than for example ext3, ext4, or xfs), you might need to unmount the file system so that it is not in use. In that case:

      • Stop Satellite services:
      # foreman-maintain service stop
      • Grow the file system on the LV.
      • Start Satellite services:
      # foreman-maintain service start
  3. If some Pulp tasks failed due to the full disk, run them again.

11.5. Reclaiming Disk Space from MongoDB

The MongoDB database can use a large amount of disk space especially in heavily loaded deployments. The following procedure describes how to reclaim some of this disk space.

Prerequisites

To reclaim disk space from MongoDB

  1. Access the MongoDB shell:

    # mongo pulp_database
  2. Check the amount of disk space used by MongoDB before a repair:

    > db.stats()
  3. Ensure that you have free disk space equal to the size of your current MongoDB database plus 2 GB. If the volume containing the MongoDB database lacks sufficient space, you can mount a separate volume and use that for the repair.
  4. Enter the repair command:

    > db.repairDatabase()

    Note that the repair command blocks all other operations and can take a long time to complete, depending on the size of the database.

  5. Check the amount of disk space used by MongoDB after a repair:

    > db.stats()
  6. Start Pulp services:

    # systemctl start goferd httpd pulp_workers pulp_celerybeat \
    pulp_resource_manager pulp_streamer

11.6. Using Red Hat Insights with Satellite Server

You can use Red Hat Insights to diagnose systems and downtime related to security exploits, performance degradation and stability failures. You can use the dashboard to quickly identify key risks to stability, security, or performance. You can sort by category, view details of the impact and resolution, and then determine what systems are affected.

Note that you do not need to add a Red Hat Insights entitlement to your subscription manifest.

To use Red Hat Insights in Satellite, you must first install and register your hosts with Red Hat Insights.

To install or register your host using Puppet, or manually, see Red Hat Insights Getting Started.

Deploying Red Hat Insights Using the Ansible role

You can automate the installation and registration of hosts with Red Hat Insights using the RedHatInsights.insights-client Ansible role. To add this role to your Satellite, follow the procedures Chapter 4, Managing Ansible Roles.

  1. Add the RedHatInsights.insights-client role to the hosts. For new hosts, see Creating a Host, or to add the role to an existing host, see Assigning Ansible Roles to Existing Hosts.
  2. To run the RedHatInsights.insights-client role on your host, navigate to Hosts > All Hosts and click the name of the host that you want to use.
  3. Click the Run Ansible roles button.

When the role completes, you can view and work with the host that you add on the Insights > Overview page of the Satellite web UI.

Additional information

  • To apply any system updates to the Red Hat Insights plugin, use httpd restart after updating.
  • To view the logs for Red Hat Insights and all plugins, go to /var/log/foreman/production.log.
  • If you have problems connecting to Red Hat Insights, ensure that your certificates are up-to-date. Refresh your subscription manifest to update your certificates.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.