Synchronizing content to orcharhino
Synchronize added repositories to download content into orcharhino, then keep it current with ad hoc runs or recurring sync plans. Configure network access and HTTP proxies for restricted environments, and use advanced synchronization to troubleshoot issues.
Configuring network for content synchronization
Content synchronization requires outbound access to upstream URLs. Adjust SELinux, HTTP proxies, and per-product or per-repository HTTP proxy policies if your environment restricts or inspects that traffic.
Configuring SELinux to permit content synchronization on custom ports
Add a TCP port to the SELinux http_port_t type when upstream content servers use a port that orcharhino cannot reach by default for synchronization.
By default, connecting to web servers running on the following ports is permitted: 80, 81, 443, 488, 8008, 8009, 8443, and 9000.
-
On orcharhino Server, verify the ports that are permitted by SELinux for content synchronization:
$ semanage port -l | grep ^http_port_t http_port_t tcp 80, 81, 443, 488, 8008, 8009, 8443, 9000 -
Configure SELinux to permit a custom port for content synchronization, for example 10011:
$ semanage port -a -t http_port_t -p tcp 10011
Adding an HTTP proxy by using orcharhino management UI
You can add HTTP proxies to orcharhino. You can then specify which HTTP proxy to use for products, repositories, and supported compute resources.
-
In the orcharhino management UI, navigate to Infrastructure > HTTP Proxies.
-
Select New HTTP Proxy.
-
In the Name field, enter a name for the HTTP proxy.
-
In the URL field, enter the URL for the HTTP proxy, including the port number.
-
If your HTTP proxy requires authentication, enter a Username and Password.
-
In the Cacert field, enter the SSL CA certificate if your HTTP proxy requires authentication.
-
Optional: In the Test URL field, enter a URL, then click Test Connection to ensure that orcharhino Server can connect to the URL through your HTTP proxy.
-
Optional: Select the Default content HTTP proxy option to set your HTTP proxy as default to synchronize content.
-
Click the Locations tab and add a location.
-
Click the Organization tab and add an organization.
-
Click Submit.
Adding an HTTP proxy by using Hammer CLI
You can add HTTP proxies to orcharhino. You can then specify which HTTP proxy to use for products, repositories, and supported compute resources.
-
Add your HTTP proxy to orcharhino:
$ hammer http-proxy create \ --name My_HTTP_Proxy \ --url http-proxy.example.com:8080Optional: To set the HTTP proxy as default for content synchronization, add the
--content-default-http-proxy trueoption.If your HTTP proxy requires authentication, add the
--username My_User_Nameand--password My_Passwordoptions.
Changing the HTTP proxy policy for a product
For granular control over network traffic, you can set an HTTP proxy policy for each product. An HTTP proxy policy of a product applies to all repositories in the product, unless you set a different policy for individual repositories.
To set an HTTP proxy policy for individual repositories, see Changing the http proxy policy for a repository by using orcharhino management UI.
-
In the orcharhino management UI, navigate to Content > Products and select the products that you want to change.
-
From the Select Action list, select Manage HTTP Proxy.
-
Select an HTTP Proxy Policy from the list:
-
Global Default: Use the global default proxy setting.
-
No HTTP Proxy: Do not use an HTTP proxy, even if a global default proxy is configured.
-
Use specific HTTP Proxy: Select an HTTP Proxy from the list. You must add HTTP proxies to orcharhino before you can select a proxy from this list. For more information, see Adding an http proxy by using orcharhino management UI.
-
-
Click Update.
Changing the HTTP proxy policy for a repository by using orcharhino management UI
You can set an HTTP proxy policy to synchronize repositories to orcharhino Server. Use an HTTP proxy for repository synchronization if your network restricts access to the internet.
-
In the orcharhino management UI, navigate to Content > Products and click the name of the product that contains the repository.
-
In the Repositories tab, click the name of the repository.
-
Locate the HTTP Proxy field and click the edit icon.
-
Select an HTTP Proxy Policy from the list:
-
Global Default: Use the global default HTTP proxy setting.
-
No HTTP Proxy: Do not use an HTTP proxy, even if a global default HTTP proxy is configured.
-
Use specific HTTP Proxy: Select an HTTP Proxy from the list. You must add HTTP proxies to orcharhino before you can select a proxy from this list.
-
-
Click Save.
Changing the HTTP proxy policy for a repository by using Hammer CLI
You can set an HTTP proxy policy to synchronize repositories to orcharhino Server. Use an HTTP proxy for repository synchronization if your network restricts access to the internet.
-
Specify the HTTP proxy policy you want to use:
$ hammer repository update \ --http-proxy-policy My_HTTP_Proxy_Policy \ --id My_Repository_ID
Specify one of the following options for
--http-proxy-policy:-
none: Do not use an HTTP proxy, even if a global default HTTP proxy is configured. -
global_default_http_proxy: Use the global default HTTP proxy setting. -
use_selected_http_proxy: Specify an HTTP proxy using either--http-proxy My_HTTP_Proxy_Nameor--http-proxy-id My_HTTP_Proxy_ID.
-
Synchronizing repositories ad hoc
You must synchronize repositories to download content into orcharhino. Use ad hoc synchronization for the initial download or whenever you need to update repositories manually.
The synchronization duration depends on the size of each repository and the speed of your network connection. The following table provides estimates of how long it would take to synchronize content, depending on the available internet bandwidth:
| Single Package (10Mb) | Minor Release (750Mb) | Major Release (6Gb) | |
|---|---|---|---|
256 Kbps |
5 Mins 27 Secs |
6 Hrs 49 Mins 36 Secs |
2 Days 7 Hrs 55 Mins |
512 Kbps |
2 Mins 43.84 Secs |
3 Hrs 24 Mins 48 Secs |
1 Day 3 Hrs 57 Mins |
T1 (1.5 Mbps) |
54.33 Secs |
1 Hr 7 Mins 54.78 Secs |
9 Hrs 16 Mins 20.57 Secs |
10 Mbps |
8.39 Secs |
10 Mins 29.15 Secs |
1 Hr 25 Mins 53.96 Secs |
100 Mbps |
0.84 Secs |
1 Min 2.91 Secs |
8 Mins 35.4 Secs |
1000 Mbps |
0.08 Secs |
6.29 Secs |
51.54 Secs |
Schedule product synchronization by creating a sync plan to ensure updates on a regular basis.
Synchronizing repositories by using orcharhino management UI
Run an ad hoc synchronization for selected repositories to download the latest upstream content into orcharhino.
-
In the orcharhino management UI, navigate to Content > Products.
-
Select the product that contains the repositories that you want to synchronize.
-
Select the repositories that you want to synchronize and click Sync Now.
-
In the orcharhino management UI, navigate to Content > Sync Status.
-
Expand the corresponding product or repository tree.
-
Verify that the synchronization is complete.
Synchronizing repositories by using Hammer CLI
Run an ad hoc synchronization for a product or individual repository to download the latest upstream content into orcharhino.
-
Synchronize an entire product:
$ hammer product synchronize \ --name "My_Product" \ --organization "My_Organization" -
Synchronize an individual repository:
$ hammer repository synchronize \ --name "My_Repository" \ --organization "My_Organization" \ --product "My_Product"
Synchronizing all repositories in an organization
Run an asynchronous Hammer CLI script to synchronize every repository in an organization when you need to refresh all content at once.
-
Log in to your orcharhino Server using SSH.
-
Run the following Bash script:
ORG="My_Organization" for i in $(hammer --no-headers --csv repository list --organization $ORG --fields Id) do hammer repository synchronize --id ${i} --organization $ORG --async done
Scheduling product synchronization
Sync plans run repository synchronization on a schedule. Assign a sync plan to one or more products so updates are fetched automatically.
Best practices for sync plans
Apply sync plan scheduling and automation patterns that keep content current without overloading orcharhino during large synchronizations.
-
Add sync plans to products and regularly synchronize content to keep the load on orcharhino low during synchronization. Synchronize content rather more often than less often. For example, setup a sync plan to synchronize content every day rather than only once a month.
-
Automate the creation and update of sync plans by using a Hammer script or an Ansible Playbook.
-
Distribute synchronization tasks over several hours to reduce the task load by creating multiple sync plans with the Custom Cron option.
| Cron expression | Explanation |
|---|---|
|
every day at 22:00 from Monday to Friday |
|
at 03:30 every Saturday and Sunday |
|
at 02:30 every day between the 8th and the 14th days of the month |
Creating a sync plan by using orcharhino management UI
A sync plan checks and updates the content at a scheduled date and time. In orcharhino, you can create a sync plan and assign products to the plan.
-
In the orcharhino management UI, navigate to Content > Sync Plans.
-
Click New Sync Plan.
-
In the Name field, enter a name for the plan.
-
Optional: In the Description field, enter a description of the plan.
-
From the Interval list, select the interval at which you want the plan to run.
-
From the Start Date and Start Time lists, select when to start running the sync plan.
-
Click Save.
Creating a sync plan by using Hammer CLI
A sync plan checks and updates the content at a scheduled date and time. In orcharhino, you can create a sync plan and assign products to the plan.
-
Create a sync plan:
$ hammer sync-plan create \ --description "My_Description" \ --enabled true \ --interval daily \ --name "My_Products" \ --organization "My_Organization" \ --sync-date "2023-01-01 01:00:00"
-
View the available sync plans for an organization to verify that the sync plan has been created:
$ hammer sync-plan list --organization "My_Organization"
Assigning a sync plan to a product by using orcharhino management UI
A sync plan checks and updates the content at a scheduled date and time. In orcharhino, you can assign a sync plan to products to update content regularly.
-
In the orcharhino management UI, navigate to Content > Products.
-
Select a product.
-
On the Details tab, select a Sync Plan from the drop down menu.
Assigning a sync plan to a product by using Hammer CLI
A sync plan checks and updates the content at a scheduled date and time. In orcharhino, you can assign a sync plan to products to update content regularly.
-
Assign a sync plan to a product:
$ hammer product set-sync-plan \ --name "My_Product_Name" \ --organization "My_Organization" \ --sync-plan "My_Sync_Plan_Name"
Assigning a sync plan to multiple products
Assign one sync plan to every product in an organization that has been synchronized at least once and has repositories by using a Hammer script.
-
Run the following Bash script:
ORG="My_Organization" SYNC_PLAN="daily_sync_at_3_a.m" hammer sync-plan create --name $SYNC_PLAN --interval daily --sync-date "2023-04-5 03:00:00" --enabled true --organization $ORG for i in $(hammer --no-headers --csv --csv-separator="|" product list --organization $ORG --per-page 999 | grep -vi not_synced | awk -F'|' '$5 != "0" { print $1}') do hammer product set-sync-plan --sync-plan $SYNC_PLAN --organization $ORG --id $i done -
After executing the script, view the products assigned to the sync plan:
$ hammer product list --organization $ORG --sync-plan $SYNC_PLAN
Refreshing content counts on orcharhino Proxy
Refresh content counts on your orcharhino Proxy that mirrors content so you can verify which content views and repositories are available to hosts.
-
In the orcharhino management UI, navigate to Infrastructure > orcharhino Proxies, and select the orcharhino Proxy where you want to see the synchronized content.
-
Select the Overview tab.
-
Under Content Sync, toggle the Synchronize button to do an Optimized Sync or a Complete Sync to synchronize the orcharhino Proxy which refreshes the content counts.
-
Select the Content tab.
-
Choose an Environment to view content views available to those orcharhino Proxies by clicking >.
-
Expand the content view by clicking > to view repositories available to the content view and the specific version for the environment.
-
View the number of content counts under Packages specific to Yum repositories.
-
View the number of errata, package groups, files, container tags, container manifests, and Ansible collections under Additional content.
-
Click the options icon in the column to the right next to the environment and click Refresh counts to refresh the content counts synchronized on the orcharhino Proxy under Packages.
Advanced synchronization options
Use advanced synchronization when standard synchronization leaves packages missing or corrupted on orcharhino Server.
Advanced synchronization has the following options:
- Optimized Sync
-
Synchronizes the repository bypassing packages that have no detected differences from the upstream packages.
- Complete Sync
-
Synchronizes all packages regardless of detected changes. Use this option if specific packages could not be downloaded to the local repository even though they exist in the upstream repository.
- Verify Content Checksum
-
Synchronizes all packages and then verifies the checksum of all packages locally. If the checksum of an RPM differs from the upstream, it re-downloads the RPM. This option is relevant only for Yum content. Use this option if you have one of the following errors:
-
Specific packages cause a
404error while synchronizing withyum. -
Package does not match intended downloaderror, which means that specific packages are corrupted.
-
|
The text and illustrations on this page are licensed by ATIX AG under a Creative Commons Attribution Share Alike 4.0 International ("CC BY-SA 4.0") license. This page also contains text from the official Foreman documentation which uses the same license ("CC BY-SA 4.0"). |