How to create a mirror

rsync
mirror

(Hans Tovetjärn) #1

Mirrors are servers which store releases and packages, so that users may choose a server closer to their location than the origin server (rsync.chakralinux.org). This will both reduce the bandwidth usage for the origin server and reduce the amount of time taken for the user to download files.

The official mirrorlist is available in the package core/pacman-mirrorlist, and the source can be viewed here. You can view the current status of the known mirrors here. If you want your mirror to be included, send an e-mail to staff@chakralinux.org with the URL and your contact information.

Requirements

To create a mirror, you will need a server with at least 32 GiB for packages and 70 GiB for releases. The size may increase over time and it is recommended to have at least 128 GiB of free space.

The origin server gets about 20 TiB traffic per month. This isn’t necessarily true for all mirrors, but if yours has limited bandwidth, remember to check the traffic from time to time.

Configuration

You need rsync on your server. To create or update a mirror of the package repositories into the directory ./packages, run:

$ rsync -av --delete-after rsync.chakralinux.org::packages packages

Likewise, for the releases:

$ rsync -av --delete-after rsync.chakralinux.org::releases releases

Consider creating a cronjob or systemd timer to synchronise at least twice a day.