Hey folks,
I just did an update on a system that is taking the better part of a day ( 5.3 ---> 5.7 ) mainly due to file download times.
And I have 4 or 5 more systems to do.
I know I can create my own repository and then point them at it - but that is difficult here because rsync is blocked (ggrrrrrr...)
Surely there must be a way to have yum on the first box automatically cache everything and then have the other boxes use the cache? Maybe if not directly, then with squid or something like that?
Anyone happen to have done this before?
thanks, -Alan
Am 12.12.2011 21:49, schrieb Alan McKay:
Hey folks,
I just did an update on a system that is taking the better part of a day ( 5.3 ---> 5.7 ) mainly due to file download times.
And I have 4 or 5 more systems to do.
I know I can create my own repository and then point them at it - but that is difficult here because rsync is blocked (ggrrrrrr...)
Surely there must be a way to have yum on the first box automatically cache everything and then have the other boxes use the cache? Maybe if not directly, then with squid or something like that?
Anyone happen to have done this before?
i am using this script since years to have running one build/update-server caching all packages in a local-repo and all other machines in the network have only the via http exported cache-repo active
this machine must have all packages used in the whole network installed this si for fedora, but CentOS should not be the big difference
1. you save bandwith / time 2. you can be sure that all machines having the same package-versions
[root@buildserver:~]$ cat /buildserver/repo-cache.sh #!/bin/bash basearch=`uname -i` releasever=`rpm -q --qf "%{version}\n" fedora-release` # Alle Subfolder unter "/var/cache/yum" durchlaufen und RPM-Pakete # in das eigene Repo kopieren for g in `ls -1b /var/cache/yum` do if [ -d /var/cache/yum/$g/packages ] then echo "/var/cache/yum/$g/packages/ > /repo/cache/fc$releasever/" sudo cp --verbose /var/cache/yum/$g/packages/*.rpm /repo/cache/fc$releasever/ 2> /dev/null fi done sudo createrepo -d /repo/cache/fc$releasever/ sudo chown -R builduser:builduser /repo/cache/fc$releasever/ sudo chmod -R 755 /repo/cache/fc$releasever/
On Monday, December 12, 2011, Alan McKay alan.mckay@gmail.com wrote:
Surely there must be a way to have yum on the first box automatically
cache
everything and then have the other boxes use the cache? Maybe if not directly, then with squid or something like that?
You can find the RPMs in /var/cache/yum (from memory, so doubt check)
For CentOS 5 I've used automirror ( http://terrarum.net/administration/caching-rpms-with-automirror.html), but it has a note that it doesn't work with CentOS 6. I have tries what that page suggests as a replacement.
For CentOS 5 I've used automirror ( http://terrarum.net/administration/caching-rpms-with-automirror.html), but it has a note that it doesn't work with CentOS 6. I have tries what that page suggests as a replacement.
Bingo! That's exactly what I need!
Thanks!
On 12/12/11 12:49 PM, Alan McKay wrote:
I know I can create my own repository and then point them at it - but that is difficult here because rsync is blocked (ggrrrrrr...)
I use this script to create a full mirror of a repository, using LFTP rather than RSYNC...
#!/usr/bin/sh /usr/bin/lftp -c 'open ftp://mirrors.kernel.org && lcd /export/mirror && mirror --continue --verbose=1 -x ia64 -x s390 -x s390x -x alpha -x SRPMS centos'
I run this once a week via crontab (and manually if I know there are important updates).
This creates /export/mirror/centos which I share locally as both http and nfs, it includes all versions and flavors except itanium, s390, alpha, and the SRPMS. specifically it DOES include all the ISO's (I nfs mount those on my vmware servers for installs...).
lftp has been far more robust than rsync ever was.
I also configure my local centos installs with /etc/yum.repos.d/CentOS-Base.repo.conf as
baseurl=http://mirror.myserver.domain.com/mirror/centos/$releasever/os/$basearch/
(for all categories in said .conf file)
On Dec 12, 2011, at 3:49 PM, Alan McKay wrote:
I know I can create my own repository and then point them at it - but that is difficult here because rsync is blocked (ggrrrrrr...)
I had this same problem at work. RSync was blocked, and I had a bunch of machines to update. I installed a SpaceWalk server (http://spacewalk.redhat.com/) to get around this. It downloads the packages via http and even has fields for proxy, username & password to work with an authenticating proxy.
There's a good tutorial on the CentOS wiki for this: http://wiki.centos.org/HowTos/PackageManagement/Spacewalk
-Chris