Questo contenuto non è disponibile nella lingua selezionata.
Chapter 6. Optimizing content synchronization and storage
Download and mirroring policies control how much content is stored locally and how repositories stay in sync with upstream sources. Tune defaults, concurrency, and retention to balance disk use, bandwidth, and freshness.
6.1. Download policies overview Copia collegamentoCollegamento copiato negli appunti!
Red Hat Satellite provides multiple download policies for synchronizing RPM content. For example, you might want to download only the content metadata while deferring the actual content download for later.
Satellite Server has the following policies:
- Immediate
- Satellite Server downloads all metadata and packages during synchronization.
- On Demand
- Satellite Server downloads only the metadata during synchronization. Satellite Server only fetches and stores packages on the file system when Capsules or directly connected clients request them. This setting has no effect if you set a corresponding repository on a Capsule to Immediate because Satellite Server is forced to download all the packages.
The On Demand policy acts as a Lazy Synchronization feature because they save time synchronizing content. The lazy synchronization feature must be used only for Yum repositories. You can add the packages to content views and promote to lifecycle environments as normal.
Capsule Server has the following policies:
- Immediate
- Capsule Server downloads all metadata and packages during synchronization. Do not use this setting if the corresponding repository on Satellite Server is set to On Demand as Satellite Server is forced to download all the packages.
- On Demand
- Capsule Server only downloads the metadata during synchronization. Capsule Server fetches and stores packages only on the file system when directly connected clients request them. When you use an On Demand download policy, content is downloaded from Satellite Server if it is not available on Capsule Server.
- Inherit
- Capsule Server inherits the download policy for the repository from the corresponding repository on Satellite Server.
- Streamed Download Policy
- Streamed Download Policy for Capsules permits Capsules to avoid caching any content. When content is requested from the Capsule, it functions as a proxy and requests the content directly from the Satellite.
6.2. Changing the default download policy by using Satellite web UI Copia collegamentoCollegamento copiato negli appunti!
You can set the default download policy that Satellite applies to repositories that you create in all organizations.
Depending on whether it is a Red Hat or non-Red Hat custom repository, Satellite uses separate settings. Changing the default value does not change the setting in existing repositories, but only the default setting for new repositories.
Procedure
- In the Satellite web UI, navigate to Administer > Settings.
- Click the Content tab.
Change the default download policy depending on your requirements:
- To change the default download policy for a Red Hat repository, change the value of the Default Red Hat Repository download policy setting.
- To change the default download policy for a custom repository, change the value of the Default Custom Repository download policy setting.
6.3. Changing the default download policy by using Hammer CLI Copia collegamentoCollegamento copiato negli appunti!
You can set the default download policy that Satellite applies to repositories that you create in all organizations.
Depending on whether it is a Red Hat or non-Red Hat custom repository, Satellite uses separate settings. Changing the default value does not change the setting in existing repositories, but only the default setting for new repositories.
Procedure
To change the default download policy for Red Hat repositories to one of
immediateoron_demand, enter the following command:$ hammer settings set \ --name default_redhat_download_policy \ --value immediateTo change the default download policy for a non-Red Hat custom repository to one of
immediateoron_demand, enter the following command:$ hammer settings set \ --name default_download_policy \ --value immediate
6.4. Changing the download policy for a repository by using Satellite web UI Copia collegamentoCollegamento copiato negli appunti!
You can set the download policy for a repository by using the Satellite web UI.
Procedure
- In the Satellite web UI, navigate to Content > Products.
- Select the required product name.
- On the Repositories tab, click the required repository name, locate the Download Policy field, and click the edit icon.
- From the list, select the required download policy and then click Save.
6.5. Changing the download policy for a repository by using Hammer CLI Copia collegamentoCollegamento copiato negli appunti!
You can set the download policy for a repository by using Hammer CLI.
Procedure
List the repositories for an organization:
$ hammer repository list \ --organization-label My_Organization_LabelChange the download policy for a repository to
immediateoron_demand:$ hammer repository update \ --download-policy immediate \ --name "My_Repository" \ --organization-label My_Organization_Label \ --product "My_Product"
6.6. Mirroring policies overview Copia collegamentoCollegamento copiato negli appunti!
Mirroring keeps the local repository exactly in synchronization with the upstream repository. If any content is removed from the upstream repository since the last synchronization, with the next synchronization, it will be removed from the local repository as well.
You can use mirroring policies for finer control over mirroring of repodata and content when synchronizing a repository. For example, if it is not possible to mirror the repodata for a repository, you can set the mirroring policy to mirror only content for this repository.
Satellite Server has the following mirroring policies:
- Additive
- Neither the content nor the repodata is mirrored. Thus, only new content added since the last synchronization is added to the local repository and nothing is removed.
- Content Only
- Mirrors only content and not the repodata. Some repositories do not support metadata mirroring, in such cases you can set the mirroring policy to content only to only mirror the content.
- Complete Mirroring
Mirrors content as well as repodata. This is the fastest method. This mirroring policy is only available for Yum content.
WarningAvoid republishing metadata for repositories with Complete Mirror mirroring policy. This also applies to content views containing repositories with the Complete Mirror mirroring policy.
6.7. Changing the default mirroring policy by using Satellite web UI Copia collegamentoCollegamento copiato negli appunti!
You can set the default mirroring policy that Satellite applies to your custom repository that you create in all organizations.
Depending on whether it is a Yum or non-Yum custom repository, Satellite uses separate settings. Only Yum repositories support the mirror_complete mirroring policy. Red Hat repositories use the mirror_complete policy by default and are not affected by these settings. Changing the default value does not change existing mirroring policy settings per repository. For more information on mirroring policies, see Section 6.6, “Mirroring policies overview”.
Procedure
- In the Satellite web UI, navigate to Administer > Settings.
- Click the Content tab.
Change the default mirroring policy depending on your requirements:
- To change the default mirroring policy for a Yum custom repository, change the value of the Default custom yum repository mirroring policy setting.
- To change the default mirroring policy for a non-Yum custom repository, change the value of the Default custom non-yum repository mirroring policy setting.
6.8. Changing the default mirroring policy by using Hammer CLI Copia collegamentoCollegamento copiato negli appunti!
You can set the default mirroring policy that Satellite applies to your custom repository that you create in all organizations.
Depending on whether it is a Yum or non-Yum custom repository, Satellite uses separate settings. Only Yum repositories support the mirror_complete mirroring policy. Red Hat repositories use the mirror_complete policy by default and are not affected by these settings. Changing the default value does not change existing mirroring policy settings per repository. For more information on mirroring policies, see Section 6.6, “Mirroring policies overview”.
Procedure
Change the default mirroring policy for a Yum custom repository to
additive,mirror_content_only, ormirror_complete:$ hammer settings set \ --name default_yum_mirroring_policy \ --value mirror_completeChange the default mirroring policy for a non-Yum custom repository to
additiveormirror_content_only:$ hammer settings set \ --name default_non_yum_mirroring_policy \ --value additive
6.9. Changing the mirroring policy for a repository by using Satellite web UI Copia collegamentoCollegamento copiato negli appunti!
You can set the mirroring policy for a repository by using the Satellite web UI.
Procedure
- In the Satellite web UI, navigate to Content > Products.
- Select the product name.
- On the Repositories tab, click the repository name, locate the Mirroring Policy field, and click the edit icon.
- From the list, select a mirroring policy and click Save.
6.10. Changing the mirroring policy for a repository by using Hammer CLI Copia collegamentoCollegamento copiato negli appunti!
You can set the mirroring policy for a repository by using Hammer CLI.
Procedure
List the repositories for an organization:
$ hammer repository list \ --organization-label My_Organization_LabelChange the mirroring policy for a repository to
additive,mirror_complete, ormirror_content_only:$ hammer repository update \ --id My_Repository_ID \ --mirroring-policy mirror_complete
6.11. Limiting synchronization concurrency Copia collegamentoCollegamento copiato negli appunti!
By default, each Repository Synchronization job can fetch up to ten files at a time. This can be adjusted on a per repository basis.
Increasing the limit may improve performance, but can cause the upstream server to be overloaded or start rejecting requests. If you are seeing Repository syncs fail due to the upstream servers rejecting requests, you may want to try lowering the limit.
Procedure
Define a value for synchronization concurrency:
$ hammer repository update \ --download-concurrency 5 \ --id Repository_ID \ --organization "My_Organization"
6.12. Limiting growth of synchronized content by using Satellite web UI Copia collegamentoCollegamento copiato negli appunti!
You can limit the growth of content in the Library lifecycle environment on Satellite Server by restraining the number of package versions in synchronized repositories.
Procedure
- In the Satellite web UI, navigate to Content > Products.
- Select your product.
- On the Repository tab, select your repository.
-
Set the Mirroring Policy to
Additive. Define the number of retained package versions:
-
Set Retain package versions to
1to only keep the latest synchronized package version on Satellite. -
Set Retain package versions to
2or higher to keep multiple package versions on Satellite.
-
Set Retain package versions to
Additional resources
6.13. Limiting growth of synchronized content by using Hammer CLI Copia collegamentoCollegamento copiato negli appunti!
You can limit the growth of content in the Library lifecycle environment on Satellite Server by restraining the number of package versions in synchronized repositories.
Procedure
Configure your repository to retain a limited number of package versions in Satellite:
$ hammer repository update \ --id My_Repository_ID \ --mirroring-policy additive \ --retain-package-versions-count My_Package_Versions_Count-
Set My_Package_Versions_Count to
1to only keep the latest synchronized package version on Satellite. -
Set My_Package_Versions_Count to
2or higher to keep multiple package versions on Satellite.
-
Set My_Package_Versions_Count to
Additional resources