Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Local Distfiles
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Finder
n00b
n00b


Joined: 19 Oct 2004
Posts: 2

PostPosted: Tue Oct 19, 2004 9:04 am    Post subject: Local Distfiles Reply with quote

Hi, I'm new to gentoo and came up with something I couldn't find on the forums, though it is a simple concept(that evaded me for a few weeks). The general idea is this: my desktop is my main computer, and I pretty much download everything onto it, and have everything I want on it under Gentoo. I also have a laptop that has a much smaller hard drive, but that I still have gentoo on and want to be able to emerge files on without downloading the whole thing from the internet(since 99% of the emerges I do on my laptop already exist on my desktop as distfiles.)
So what I did was I set up my desktop to run apache, created a directory of gentoo, and within that made a symlink to my distfiles directory. Since my router is blocking access to my port I run apache at, this is only available to my local network. Now, I did a mirrorselect on my laptop to select some real mirrors, and in the beginning of the GENTOO_MIRRORS I added my desktop's ip and directory first, specifically being http://192.168.1.150/gentoo. That way, when my desktop doesn't have the distfile, it fails and continues going through the real hosts, but when it does, it downloads it directly from my desktop. Hope this helps.
Back to top
View user's profile Send private message
Deranger
Veteran
Veteran


Joined: 26 Aug 2004
Posts: 1215

PostPosted: Tue Oct 19, 2004 9:11 am    Post subject: Reply with quote

That's a very good idea if user doesn't have much BW or doesn't want to download sources again, on different computer. Thanks for the tip!
Back to top
View user's profile Send private message
flybynite
l33t
l33t


Joined: 06 Dec 2002
Posts: 620

PostPosted: Tue Oct 19, 2004 11:56 pm    Post subject: Reply with quote

This will work but has limitations as you've probably noticed. One such limitation is what happens if you download on the laptop first? Then the file is only on the laptop and not usable on the desktop!

I know if you always pay attention and download on the desktop first then you won't have this problem....

Or you could use http-replicator which has so many advantages. It works seemlessly with portage and can download a file from the internet while simultaneously streaming that same file to multiple computers. That way it doesn't matter which or how many boxes download whatever files they need - only 1 copy ever comes from the internet. The bonus is that once in the cache, other boxes can download the file at the full speed of your LAN!

See https://forums.gentoo.org/viewtopic.php?t=173226 for more info...
Back to top
View user's profile Send private message
Finder
n00b
n00b


Joined: 19 Oct 2004
Posts: 2

PostPosted: Wed Oct 20, 2004 12:38 am    Post subject: Reply with quote

That's great, I'm definitely going to try it. Looks like you've done a great job on it. :)
Back to top
View user's profile Send private message
chunderbunny
Veteran
Veteran


Joined: 31 May 2004
Posts: 1281
Location: 51°24'27" N, 0°57'15" W

PostPosted: Wed Oct 20, 2004 12:02 pm    Post subject: Reply with quote

Or you can share your /usr/portage directory over NFS. There are many ways of solving this problem. :D
Back to top
View user's profile Send private message
cuerty
Tux's lil' helper
Tux's lil' helper


Joined: 25 Jan 2003
Posts: 90
Location: Buenos Aires, Argentina

PostPosted: Wed Oct 20, 2004 6:59 pm    Post subject: Reply with quote

I like the Apache and mod_proxy and mod_cache aproach:

Code:
<VirtualHost *>
    ProxyRequests Off

    <IfModule mod_disk_cache.c>
      CacheRoot "/var/cache/gentoo"
      CacheSize 102400
      CacheGcInterval 8
      CacheMaxExpire 168
      CacheLastModifiedFactor 0.1
      CacheDefaultExpire 72
      CacheEnable disk /gentoo/
    </IfModule>

    ProxyPass /gentoo/ http://gentoo.ccccom.com/
</VirtualHost>


That and:

GENTOO_MIRRORS="http://192.168.0.1/gentoo/"

In every Gentoo installation of my home network including the webserver. Also a local mirror of rsync is recomended :D
_________________
I made a discovery today. I found a computer. Wait a second, this is cool. It does what I want it to. if it makes a mistake, it's because I screwed it up. Not Because it doesn't like me...
Back to top
View user's profile Send private message
flybynite
l33t
l33t


Joined: 06 Dec 2002
Posts: 620

PostPosted: Thu Oct 21, 2004 6:02 am    Post subject: Reply with quote

chunderbunny wrote:
Or you can share your /usr/portage directory over NFS. There are many ways of solving this problem. :D


Let me just say that sharing with NFS has possible corruption problems. See https://forums.gentoo.org/viewtopic.php?t=173226&start=133

for more detailed info.
Back to top
View user's profile Send private message
flybynite
l33t
l33t


Joined: 06 Dec 2002
Posts: 620

PostPosted: Thu Oct 21, 2004 6:17 am    Post subject: Reply with quote

cuerty wrote:
I like the Apache and mod_proxy and mod_cache aproach:


I actually started out using a custom apache module ( see https://forums.gentoo.org/viewtopic.php?t=110973&postdays=0&postorder=asc&start=0 )

But gave it up because of the drawbacks of using apache as a cache. Httpe-replicator has many advantages over an apache cache.
Back to top
View user's profile Send private message
mäkke_renamed
n00b
n00b


Joined: 20 Mar 2004
Posts: 6

PostPosted: Thu Oct 21, 2004 12:44 pm    Post subject: Reply with quote

cuerty wrote:

GENTOO_MIRRORS="http://192.168.0.1/gentoo/"


I prefer to treat my local mirror as a "local mirror"...
there is a possibility in portage to make this.
Code:
cd /etc/portage/
echo "local http://192.168.0.1/distfiles/" >> mirrors

there you can also add your favourite sf.net mirrors... see "man portage"

Code:
              mirrors
                     Whenever portage encounters a mirror:// style URL it will look up the
                     actual hosts here.  If the mirror set is  not  found  here,  it  will
                     check the global mirrors file at /usr/portage/profiles/thirdpartymir-
                     rors.  You may also set a special mirror type called  "local".   This
                     list  of  mirrors  will  be checked before GENTOO_MIRRORS and will be
                     used even if the package has RESTRICT="nomirror".

                     Format:
                     - comments begin with #
                     - mirror type followed by a list of hosts

                     Example:
                     # local private mirrors used only by my company
                     local ftp://192.168.0.3/mirrors/gentoo http://192.168.0.4/distfiles

                     # people in japan would want to use the japanese mirror first
                     sourceforge http://keihanna.dl.sourceforge.net/sourceforge

                     # people in tawain would want to use the local gnu mirror first
                     gnu ftp://ftp.nctu.edu.tw/UNIX/gnu/
Back to top
View user's profile Send private message
flybynite
l33t
l33t


Joined: 06 Dec 2002
Posts: 620

PostPosted: Sat Oct 30, 2004 6:41 pm    Post subject: Reply with quote

sure this works....

but how do you add files to the mirror from a client???


That is one of the MANY problems http-replicator solves....
Back to top
View user's profile Send private message
woZa
Guru
Guru


Joined: 18 Nov 2003
Posts: 340
Location: The Steel City - UK

PostPosted: Fri Nov 05, 2004 11:14 am    Post subject: Reply with quote

I'm with flybynite...

http-replicator works great. I can update all 5 of my machines at the same time with no problems if some want the same file (which they do most of the time as 4 of the machines are identical...)

Sharing over nfs caused me all sorts of problems trying to update all at once.
_________________
A few months struggling with gentoo is better than a lifetime struggling with windoze!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum