September 1, 2014

Using Percona rsync repositories to set up the local CentOS mirror

One of the more popular support requests we get involves setting up the official Percona rsync repositories that can be used to set up local mirrors. I’m glad to announce that this was implemented recently. You can now access the rsync repository at:


Setting up the local mirror can be useful if you have a larger number of systems and you don’t want to download packages from the remote repository multiple times, it can also be useful if the original repository is slower or inaccessible.

Setting up the local repository

Create a folder on disk where the files will be downloaded. Make sure you have enough space for this, currently repository for CentOS 6 is almost 2GB.

[root@percona1]# mkdir -p /data/repo/percona/

After this use createrepo to create all the necessary repository files:

[root@percona1]# createrepo /data/repo/percona/

After the repository files have been created you can start the download from the Percona’s rsync server (following example will download packages for 64-bit CentOS 6, you should alter the version and architecture if needed):

[root@percona1]# rsync -avrt rsync:// /data/repo/percona/

You can now use the local repository by creating the new percona-local.repo file in the /etc/yum.repos.d/ folder.

[root@percona1]# cat /etc/yum.repos.d/percona-local.repo
name=Local Percona repository

To check if the repository is set up correctly you can run:

[root@percona1]# yum update

If the previous command runs without errors, you can install Percona software from your local repository. Following example will install Percona XtraBackup:

[root@percona1]# yum install percona-xtrabackup.x86_64

If you want to keep the repository up-to-date with the official Percona repository, you’ll need to run the above mentioned rsync command either manually or you should add it to the crontab.

Sharing the packages

Previous example showed how to use the packages locally. In order to be able to distribute those packages we’ll need to install a web server. This example will use Apache web server as an example.

First set up a symbolic link to the Apache directory (default is code>/var/www/html/):

[root@percona1]# ln -s /data/repo/percona /var/www/html/percona

You can now add this local repository to other servers. To use this local repository you need to create percona-local.repo file in the /etc/yum.repos.d/ older.

[root@percona1]# cat /etc/yum.repos.d/percona-local.repo
name=Local Percona repository
#IP of the local repository server set up in the previous step

To check if the repository is set up correctly you can run:

[root@percona2]# yum update

You can now install Percona XtraBackup from your local repository:

[root@percona2]# yum install percona-xtrabackup.x86_64


  1. Moritz Schuepp says:

    The apt-repository is also accessible! Great! Thank you!!!!!!!!

Speak Your Mind