We have a rsync'ed copy of the centos distro. We want to point our local machines at that, what is our next step?
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Sr. Consultant 10 West 24th Street #100 - - +1 (443) 269-1555 x333 Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, purge the message from your system and notify the sender immediately. Any other use of the email by you is prohibited.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Jason Pyeron wrote:
We have a rsync'ed copy of the centos distro. We want to point our local machines at that, what is our next step?
Hi, Jason.
cd /etc/yum.repos.d
I'd make a backup of the original CentOS-Base.repo:
cp CentOS-Base.repo CentOS.Base.repo.org
Open CentOS-Base.repo in a text editor, vim, emacs, whatever.
Comment out all the mirrorlist's.
# mirrorlist=http://mirrorlist.centos.org/blah-blah-blah
Make sure all the baseurl's reflects your internal repo and are not commented out.
baseurl=http//your_internal_repo/centos/$releasever/os/$basearch/
You should be ok to use yum then, so long as your paths are all good. This is how I do it, anyways. Other comments or procedures are more than welcome.
Regards, Max
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Max Hetrick Sent: Tuesday, November 27, 2007 21:18 To: CentOS mailing list Subject: Re: [CentOS] Using a local mirror?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Jason Pyeron wrote:
We have a rsync'ed copy of the centos distro. We want to point our local machines at that, what is our next step?
Hi, Jason.
cd /etc/yum.repos.d
I'd make a backup of the original CentOS-Base.repo:
cp CentOS-Base.repo CentOS.Base.repo.org
Open CentOS-Base.repo in a text editor, vim, emacs, whatever.
Comment out all the mirrorlist's.
# mirrorlist=http://mirrorlist.centos.org/blah-blah-blah
Make sure all the baseurl's reflects your internal repo and are not commented out.
baseurl=http//your_internal_repo/centos/$releasever/os/$basearch/
This will be my second try after trying to find a less invasive method like proxying.
Right now when a machine pulls up mirrorlist.centos.org it will point to an internal system, whose cgi behaves as such (expecting a scale issue here, vlan based load...).
You should be ok to use yum then, so long as your paths are all good. This is how I do it, anyways. Other comments or procedures are more than welcome.
Regards, Max
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux)
iD8DBQFHTM/hHoeeepPau2ERAijzAKCCVjFEcFaCs4c2/UlE3HTELPIAggCgt4dK upBBCizZY6BRLMU4wBGSa1k= =Jr+J -----END PGP SIGNATURE----- _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Sr. Consultant 10 West 24th Street #100 - - +1 (443) 269-1555 x333 Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, purge the message from your system and notify the sender immediately. Any other use of the email by you is prohibited.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Jason Pyeron wrote:
This will be my second try after trying to find a less invasive method like proxying.
Right now when a machine pulls up mirrorlist.centos.org it will point to an internal system, whose cgi behaves as such (expecting a scale issue here, vlan based load...).
This won't help you if you're already up and running, but if you're looking to set this up during installations, then look at copying a .repo file over from a shared location with a kickstart installation file.
A post-installation shell command can do that for you down the road if you don't find Dag's tool handy. I've done this in the past to not have to edit things like this during a new install.
Regards, Max
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Jason Pyeron Sent: Tuesday, November 27, 2007 21:49 To: 'CentOS mailing list' Subject: RE: [CentOS] Using a local mirror?
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Max Hetrick Sent: Tuesday, November 27, 2007 21:18 To: CentOS mailing list Subject: Re: [CentOS] Using a local mirror?
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Jason Pyeron wrote:
We have a rsync'ed copy of the centos distro. We want to point our local machines at that, what is our
next step?
Hi, Jason.
cd /etc/yum.repos.d
I'd make a backup of the original CentOS-Base.repo:
cp CentOS-Base.repo CentOS.Base.repo.org
Open CentOS-Base.repo in a text editor, vim, emacs, whatever.
Comment out all the mirrorlist's.
# mirrorlist=http://mirrorlist.centos.org/blah-blah-blah
Make sure all the baseurl's reflects your internal repo and are not commented out.
baseurl=http//your_internal_repo/centos/$releasever/os/$basearch/
This will be my second try after trying to find a less invasive method like proxying.
Right now when a machine pulls up mirrorlist.centos.org it will point to an internal system, whose cgi behaves as such (expecting a scale issue here, vlan based load...).
Hmmm, needed to proxy the mirror.centos.org too, since up2date does not use the yum.cond.d stuff .
So to proxy
Capture all mirrorlist.centos.org and mirror.centos.org and redirect to your internal versions respectively.
Our local dns is "poisoned" to point to our internal servers. From there its all cake.
[root@host67 mirrors]# cat /var/www/html/index.cgi #!/usr/bin/perl use strict; use CGI;
my $cgi = new CGI;
my $release = $cgi->param('release'); my $arch = $cgi->param('arch'); my $repo = $cgi->param('repo');
print "Content-type: text/html\n\n"; print "http://192.168.1.67/centos/$release/$repo/$arch/%5Cn";
exit (0); [root@host67 mirrors]#
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Sr. Consultant 10 West 24th Street #100 - - +1 (443) 269-1555 x333 Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, purge the message from your system and notify the sender immediately. Any other use of the email by you is prohibited.
You should be ok to use yum then, so long as your paths are
all good.
This is how I do it, anyways. Other comments or procedures are more than welcome.
Regards, Max
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux)
iD8DBQFHTM/hHoeeepPau2ERAijzAKCCVjFEcFaCs4c2/UlE3HTELPIAggCgt4dK upBBCizZY6BRLMU4wBGSa1k= =Jr+J -----END PGP SIGNATURE----- _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Sr. Consultant 10 West 24th Street #100 - - +1 (443) 269-1555 x333 Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, purge the message from your system and notify the sender immediately. Any other use of the email by you is prohibited.
This is a bit late, I know, but I found a similar setup described at:
http://www.gurulabs.com/goodies/YUM_automatic_local_mirror.php
Their server appears to be down right now, but that's where I found the information. The original was designed for Fedora, but it was adapted to CentOS pretty easily. I've been using this for about 4 months now with great results.
Rather than spoofing the mirrorlist.centos.org entry in DNS, I just have anybody that wants to use the local mirror put an entry in their /etc/hosts file pointing to the IP address of the local server. The Perl CGI script adds the entry for our local server to the results returned from the real mirror list and depends on yum-fastestmirror to pick the local server from the list.
Since we don't mirror all architectures on our local server, I added some intelligence to the Perl script so that it would only add the local server if the requested repository, release, and architecture were on the local server. If anybody wants to see the final results, just let me know and I'll post my modified script and the Apache config fragment or a pointer to it.
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Jay Leafey Sent: Tuesday, November 27, 2007 23:21 To: CentOS mailing list Subject: Re: [CentOS] Using a local mirror? [SOLVED]
This is a bit late, I know, but I found a similar setup described at:
http://www.gurulabs.com/goodies/YUM_automatic_local_mirror.php
Their server appears to be down right now, but that's where I found the information. The original was designed for Fedora, but it was adapted to CentOS pretty easily. I've been using this for about 4 months now with great results.
Rather than spoofing the mirrorlist.centos.org entry in DNS, I just have anybody that wants to use the local mirror put an entry in their /etc/hosts file pointing to the IP address of the local server. The
Right now I am using the hosts file too.
In our server farm we are expected to make as few deviations from baseline as possible, that is why the dns redirection.
Perl CGI script adds the entry for our local server to the results returned from the real mirror list and depends on yum-fastestmirror to pick the local server from the list.
We might want to act as a gatekeeper on the mirror too, again for CM sake.
Since we don't mirror all architectures on our local server, I added some intelligence to the Perl script so that it would only add the local server if the requested repository, release, and architecture were on the local server. If anybody wants to see the final results, just let me know and I'll post my modified script and the Apache config fragment or a pointer to it.
The list might like it anyway.
-- Jay Leafey - Memphis, TN jay.leafey@mindless.com
Thanks
-jason
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Sr. Consultant 10 West 24th Street #100 - - +1 (443) 269-1555 x333 Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, purge the message from your system and notify the sender immediately. Any other use of the email by you is prohibited.
On Tue, 2007-11-27 at 20:59 -0500, Jason Pyeron wrote:
We have a rsync'ed copy of the centos distro. We want to point our local machines at that, what is our next step?
---- http://dag.wieers.com/home-made/mrepo/
does all the lifting for you
Craig
We already have our up2date / yum repo.
What we need is to (minimalistically) modify the clients to use it.
Given:
[root@test ~]# cat /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 fiftyone localhost.localdomain localhost 192.168.1.67 mirrorlist.centos.org [root@test ~]# curl -i "http://mirrorlist.centos.org/?release=4.5&arch=i386&repo=os" HTTP/1.1 200 OK Date: Wed, 28 Nov 2007 02:27:47 GMT Server: Apache/2.0.52 (CentOS) Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=UTF-8
http://192.168.1.67/centos/4.5/os/i386/
Why does it pull data from outside???
|-sendmail(2233) |-sendmail(2241,smmsp) |-sshd(3364)-+-sshd(3367)---bash(3369)---up2date(25055) | `-sshd(25010)---bash(25012)---pstree(25064) |-syslogd(2078) |-udevd(1395) `-xinetd(2213) [root@test ~]# lsof -p 25055 | grep TCP up2date 25055 root 10u IPv4 25167 TCP test.pdinc.us:33481->66.147.238.146:http (SYN_SENT)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Sr. Consultant 10 West 24th Street #100 - - +1 (443) 269-1555 x333 Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, purge the message from your system and notify the sender immediately. Any other use of the email by you is prohibited.
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org] On Behalf Of Craig White Sent: Tuesday, November 27, 2007 21:36 To: CentOS mailing list Subject: Re: ****[CentOS] Using a local mirror?
On Tue, 2007-11-27 at 20:59 -0500, Jason Pyeron wrote:
We have a rsync'ed copy of the centos distro. We want to point our local machines at that, what is our next step?
http://dag.wieers.com/home-made/mrepo/
does all the lifting for you
Craig
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos