Este conteúdo não está disponível no idioma selecionado.
Chapter 11. Maintaining Satellite Server
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, and how to recover Pulp from a full disk.
11.1. Deleting Audit Records Copiar o linkLink copiado para a área de transferência!
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
# foreman-rake audits:expire days=7
11.2. Anonymizing Audit Records Copiar o linkLink copiado para a área de transferência!
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
# foreman-rake audits:anonymize days=7
11.3. Configuring the Cleaning Unused Tasks Feature Copiar o linkLink copiado para a área de transferência!
Satellite performs regular cleaning to reduce disc space in the database and limit the rate of disk growth. As a result, Satellite backup completes faster and overall performance is higher.
By default, Satellite executes a cron job that cleans tasks every day at 19:45. Satellite removes the following tasks during the cleaning:
- Tasks that have run successfully and are older than thirty days
- All tasks that are older than a year
For Satellites Upgraded from Previous Versions
Until BZ#1788615 is resolved, this functionality works only on fresh installations of Satellite 6.10 and later. If you upgrade Satellite from previous versions, this functionality is disabled by default. To enable Satellite to perform regular cleaning, enter the following command:
satellite-installer --foreman-plugin-tasks-automatic-cleanup true
# satellite-installer --foreman-plugin-tasks-automatic-cleanup true
Optionally use this procedure to adjust the configuration to serve your needs.
Procedure
Optional: To configure the time at which Satellite runs the cron job, set the
--foreman-plugin-tasks-cron-lineparameter to the time you want in cron format. For example, to schedule the cron job to run every day at 15:00, enter the following command:satellite-installer --foreman-plugin-tasks-cron-line "00 15 * * *"
# satellite-installer --foreman-plugin-tasks-cron-line "00 15 * * *"Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Optional: To configure the period after which Satellite deletes the tasks, edit the
:rules:section in the/etc/foreman/plugins/foreman-tasks.yamlfile.
11.4. Recovering from a Full Disk Copiar o linkLink copiado para a área de transferência!
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
- Let running Pulp tasks finish but do not trigger any new ones as they can fail due to the full disk.
Ensure that the LV with the
/var/lib/pulpdirectory on it has sufficient free space. Here are some ways to achieve that:Remove orphaned content:
foreman-rake katello:delete_orphaned_content RAILS_ENV=production
# foreman-rake katello:delete_orphaned_content RAILS_ENV=productionCopy to Clipboard Copied! Toggle word wrap Toggle overflow This is run weekly so it will not free much space.
- 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 from "Immediate" to "On-Demand" on the Red Hat Customer Portal for instructions.
Grow the file system on the LV with the
/var/lib/pulpdirectory 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.NoteIf 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, complete the following steps:
Stop the
satellite-maintainservices:satellite-maintain service stop
# satellite-maintain service stopCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Grow the file system on the LV.
Start the
satellite-maintainservices:satellite-maintain service start
# satellite-maintain service startCopy to Clipboard Copied! Toggle word wrap Toggle overflow
- If some Pulp tasks failed due to the full disk, run them again.
11.5. Managing Packages on the Base Operating System of Satellite or Capsule Copiar o linkLink copiado para a área de transferência!
To install and update packages on the Satellite or Capsule base operating system, you must enter the satellite-maintain packages command.
Satellite prevents users from installing and updating packages with yum because yum might also update the packages related to Satellite or Capsule and result in system inconsistency.
The satellite-maintain packages command restarts some services on the operating system where you run it because it runs the satellite-installer command after installing packages.
Procedure
To install packages on Satellite or Capsule, enter the following command:
satellite-maintain packages install package_1 package_2
# satellite-maintain packages install package_1 package_2Copy to Clipboard Copied! Toggle word wrap Toggle overflow To update specific packages on Satellite or Capsule, enter the following command:
satellite-maintain packages update package_1 package_2
# satellite-maintain packages update package_1 package_2Copy to Clipboard Copied! Toggle word wrap Toggle overflow To update all packages on Satellite or Capsule, enter the following command:
satellite-maintain packages update
# satellite-maintain packages updateCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Using yum to Check for Package Updates
If you want to check for updates using yum, enter the command to install and update packages manually and then you can use yum to check for updates:
satellite-maintain packages unlock yum check update satellite-maintain packages lock
# satellite-maintain packages unlock
# yum check update
# satellite-maintain packages lock
Updating packages individually can lead to package inconsistencies in Satellite or Capsule. For more information about updating packages in Satellite, see Updating Satellite Server.
Enabling yum for Satellite or Capsule Package Management
If you want to install and update packages on your system using yum directly and control the stability of the system yourself, enter the following command:
satellite-maintain packages unlock
# satellite-maintain packages unlock
Restoring Package Management to the Default Settings
If you want to restore the default settings and enable Satellite or Capsule to prevent users from installing and updating packages with yum and ensure the stability of the system, enter the following command:
satellite-maintain packages lock
# satellite-maintain packages lock
11.6. Reclaiming PostgreSQL Space Copiar o linkLink copiado para a área de transferência!
The PostgreSQL database can use a large amount of disk space especially in heavily loaded deployments. Use this procedure to reclaim some of this disk space on Satellite.
Procedure
Stop all services, except for the
postgresqlservice:satellite-maintain service stop --exclude postgresql
# satellite-maintain service stop --exclude postgresqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Switch to the
postgresuser and reclaim space on the database:su - postgres -c 'vacuumdb --full --dbname=foreman'
# su - postgres -c 'vacuumdb --full --dbname=foreman'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the other services when the vacuum completes:
satellite-maintain service start
# satellite-maintain service startCopy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm that the files exist in the
/var/lib/pgsql/directory:ls -l /var/lib/pgsql/ du -sh /var/lib/pgsql/
# ls -l /var/lib/pgsql/ # du -sh /var/lib/pgsql/Copy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the data from the
/var/lib/pgsql/directory:rm -rf /var/lib/pgsql/*
# rm -rf /var/lib/pgsql/*Copy to Clipboard Copied! Toggle word wrap Toggle overflow