On Fri, Sep 18, 2015 at 7:02 PM, Daniel Frey <djqf...@gmail.com> wrote:
> Hi all, > > I have been running several Gentoo machines here at my house, and am > currently up to 7 (or was it 8?) installs. > > I have been trying to reduce my resource consumption and set up an rsync > mirror long ago, so my [acting] server only syncs to the internet and > all other devices point to it. That part is working fine, I've already > moved it to the repos.conf configuration. > > Whenever I search for running a local distfiles mirror (on this list and > on the web) it gets a bit murky. > > The way I see it is this can be done a couple of ways: > > 1. Set up a lighttpd server to serve the distfiles directory. > > This has the benefit of being able to sync machines outside my network, > although I don't know if I'd expose it to the internet. > > The major issue I can see with this is that if the file doesn't exist, > portage will crap out saying it's not available. What I don't know is if > there's an easy way to "get around" this issue. > > </1.> > > 2. Export the distfiles directory. > > This seems to be a bit better of a solution, other than not being able > to use it outside the LAN. However, cleaning this directory becomes a > lot less trivial as tools used to clean it will assume that the current > machine is the only machine using it and clobber other workstation's > required distfiles. > > I suppose the easiest way to sync is to wipe it completely out and run > `emerge -fe world` on all machines to rebuild it, but this would be a > fair bit of work as well. > > </2.> > > With those two options, neither being perfect - it made me wonder if > there's a Better Way(tm) to do this. > > In the case of a shared distfiles, it would be best if something was one > the machine hosting the distfiles monitoring what workstation needed > what file and only removing a file when no workstations request it. > Alas, I don't think a tool such as that exists (although I didn't really > look that hard.) > > Ideally, it would be nice to have some sort of caching proxy that could > fetch the file as it was needed, but in searching for this I encountered > so much noise in the search results I gave up for the time being. > > Anyone have any suggestions? > > Dan > > > > You can export distfiles via glusterfs. A single machine holds the data while the others can fetch / upload files. Glusterfs needs to be installed on each machine and fuse enabled in the kernel.