使用本地PERCONA源

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 rsyncrepository at:

rsync://rsync.percona.com/rsync/

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://rsync.percona.com/rsync/centos/6/os/x86_64/ /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
[percona-local]
name=Local Percona repository
baseurl=file:///data/repo/percona/
gpgcheck=1
enabled=1

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.repofile in the /etc/yum.repos.d/ older.

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

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

转载于:https://my.oschina.net/longquan/blog/886522

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值