6 Using Software Distribution Mirrors
Distribution mirrors are alternative sources of software packages to repositories in Oracle Linux public yum server or Unbreakable Linux Network. These are selected repositories that you locally replicate from the public server. The local repositories become the package sources for client systems that exist in the local network.
Distribution mirrors are useful in complex infrastructures and are important when developing a controlled update strategy for a mission critical production environment. Distribution mirrors are deployed to provide the following services:
- Provide access to yum repositories or ULN channels for systems that do not have access to a public network.
- Improve software download times and reducing bandwidth overhead for larger infrastructure
- Set up network-based installation infrastructure
- Cater for a snapshot style update strategy where testing can be performed against a controlled software distribution environment before the updates are implemented on production systems.
A server that functions as a software distribution mirror contains either yum repositories or ULN channels. The repositories or channels can be made available to client systems in the internal network through various methods such as using local web server, a filte transfer server, and so on.
The software distribution mirror must be synchronized with the official Oracle Linux sources. If required, you can control synchronization to occur at strategic intervals so that you can test system updates against a known set of package versions before you roll them out to all of the infrastructure.
Note:
If you are considering mirroring ULN channels on a local server, check also Oracle Linux Manager that is based on the Spacewalk open source software. Oracle Linux Manager provides tools to help with system maintenance, installation and package management. For more information, see Oracle® Linux Manager & Spacewalk for Oracle® Linux Documentation.
Prerequisites for the Local Distribution Mirror
The system that you set up as a local distribution mirror must meet the following criteria:
- Must have Internet access to be able to connect to the official Oracle Linux sources.
-
Has at least 6 GB of memory to create the yum metadata.
-
Must be configured to provide access to the mirrored repositories by system clients.
-
Has enough disk space to store copies of the packages that it hosts.
When calculating for the needed disk space, consider the following:
-
Disk space requirements depend on the repositories or channels that you choose to mirror. Additional factors are the number of clients to be serviced, including their platforms, OSs, and other specific packages that each client might be using and which would require updates.
-
Disk space that is used for a mirror is only consumed and is never released. Thus, disk requirements are not static and can increase over time.
-
Packages in the repositories or channels are also updated regularly and further affects the storage requirements on the local yum server.
For guidance in estimating the disk size requirements, run the following command:
sudo dnf repoinfo [repo-ID]
Part of the command output includes the size of a specific repository, for example:
... Repo-id : ol8_x86_64_baseos_latest ... Repo-size : 29 G ... Repo-id : ol8_addons ... Repo-size : 4.8 G ...
Because repositories are dynamic and grow over time, always plan to allocate substantially greater disk space than what
Repo-size
specifies. The more resources you can provide for disk space, the more efficient the local server can mirror ULN channels. Optionally, you can also create a dedicated file system and mount this to the directory that hosts the mirrored repositories. -
How to Set Up a Distribution Mirror
Systems can be configured to distribute packages and provide updates to client systems within a local network without the need for clients to access the public servers through the Internet.
You can select any method to provide access to the local repositories in the mirror server. This task uses HTTP as an example.
Setting Up a Local Yum Mirror
A system that functions as a local yum repository mirrors repositories from the public Oracle Linux yum server.
When Oracle Linux is installed on this system, that system automatically contains the
repositories that are required by the system's OS. These repositories are found in the
system's /etc/yum/repos.d
directory. The repositories are defined in
different /etc/yum/repos.d/*.repo
files.
By mirroring these default repositories, the system can function as a local yum server to service clients that have the same OS and platform as the mirror.
However, you might want the local yum mirror to also service clients that use different OS releases for other platforms. In this case, you would need to define additional repositories that are required by those clients.
How to Configure the Local Yum Server
Setting up a system to function as a local yum server involves mirroring required repositories from the public Oracle Linux yum server.
The designated yum mirror must meet the requirements described in Prerequisites for the Local Distribution Mirror. Additionally, you must have completed the procedure in How to Set Up a Distribution Mirror.
You can mirror any repository available on the Oracle Linux yum server, provided that you
have the definition for the repository configured in /etc/yum.repos.d
.
Mirroring repositories that the system already has available is uncomplicated. However, for
other repositories, you might need to be more specific about the which repositories you want
to mirror. Moreover, you might need to provide additional repository configuration.
How to Use rsync to Mirror the Oracle Linux Yum Server
Oracle provides an rsync
interface to the Oracle Linux yum server
repositories at the yum-rsync.oracle.com
domain that maps directly to the
URL structure of the Oracle Linux yum server.
With the rsync
interface, you can easily mirror the Oracle Linux yum
server for broader usage without any requirement for complex system configuration.
This approach is helpful for large enterprises that want to mirror entire repository
structures for all architectures. The rsync
interface is an
alternative method to running the reposync
command to synchronize
mirrored repositories.
How to Mirror Repositories From an ISO
The local yum mirror can be configured to mirror repositories from an ISO image to make them available to clients.
This task assumes that you are mirroring the repositories from an Oracle Linux 8 image. It also assumes that to grant access to the mirror, you are using a web server.
Setting Up a Local ULN Mirror
A system that functions as a local ULN server mirrors channels in the Unbreakable Linux Network.
When you register an Oracle Linux system with ULN, that system is automatically subscribed to default channels in ULN, depending on the system's OS release and architecture. As such, the system can become a mirror to service clients that have the same OS and platform as the mirror.
However, you might also want the local ULN mirror to service clients that use different OS releases for other platforms. In this case, you would need to subscribe to additional channels that are required by those clients.
How to Configure the Local ULN Mirror
Setting up the system to be a local ULN mirror involves replicating channels from Unbreakable Linux Network.
The designated ULN mirror must meet the requirements described in Prerequisites for the Local Distribution Mirror. Additionally, you must have completed the followng tasks:
For each step in this procedure, you can use either the ULN web interface or the
uln-channel
command. To display options that you can use with the
uln-channel
command, type uln-channel -h
.
How to Localize Subscriptions for the ULN Mirror
Localizing the ULN mirror's channel subscriptions prevents the mirror's packages from being updated that would cause package collisions and damage package dependencies.
This task is required for ULN mirrors that serve heterogeneous clients. In this case, the mirror subscribes to multiple channels, including channels the mirror itself does not need. You would need to configure the mirror to prevent its own channel subscriptions from being updated with packages targeted for other clients.
Suppose that the mirror is an Oracle Linux 9 system but is also serving Oracle Linux 8 clients on the x86_64 platform. The following steps would localize the Oracle Linux 9's channel subscriptions:
How to Configure Client Access to the Local Mirror
Clients require access to the local repository mirror to receive updates and errata fixes.
Perform this task on all the clients in the local network. Use this same procedure to configure the local ULN mirror as a client of itself.
Note:
On Oracle Linux 8 and later clients, use thednf
command. On earlier
clients, use the yum
command.