Gentoo Archives: gentoo-server

From: Andy Dustman <farcepest@×××××.com>
To: gentoo-server@l.g.o
Subject: Re: [gentoo-server] multiple gentoo boxes, master file fetcher & override fetch restriction
Date: Thu, 04 Nov 2004 16:26:52
Message-Id: 9826f38004110408261f22af4@mail.gmail.com
In Reply to: [gentoo-server] multiple gentoo boxes, master file fetcher & override fetch restriction by TRauMa
1 Here's my setup:
2
3 My local portage mirror (portage tree and distfiles) is on a NetApp
4 Filer, which is basically a dedicated NFS server (it can do CIFS as
5 well and serve static web pages, but that's besides the point). I have
6 a local server which mounts this rw, and I have a cron job that runs
7 "emerge -q sync" at 7:45 a.m. weekdays. Most of the clients (the ones
8 that do NFS) mount the portage tree ro, and get the distfiles via
9 http. A few clients mount the portage tree and distfiles rw. I also
10 run an rsync server for some clients that don't use NFS at all.
11
12 Generally the rsync server can be a little slow, because it is having
13 to traverse the entire Portage tree via NFS (a stat call for each
14 file), which introduces some latency; once it has some stuff cached,
15 it is a lot faster. The same symptom occurs, to a lesser extent, on
16 clients which use an NFS Portage tree. However, if you are updating
17 the clients, say, weekly, this does not seem to be a big drawback.
18
19 One big gotcha with the Filer: Depending on the configuration, if your
20 portage tree the root of an NFS mount from a Filer, you will likely
21 have a .snapshot directory. This directory may contain dozens of
22 subdirectories, each of which contains an entire copy of the Portage
23 tree at some instant in time. This makes the rsync extremely painful.
24 The fix for this is to add to make.conf:
25
26 RSYNC_EXCLUDEFROM="/etc/portage/excludefrom"
27
28 and then create /etc/portage/excludefrom with the line:
29
30 .snapshot
31
32 This is only required for a host which NFS-mounts the Portage tree
33 from a NetApp Filer *and* does "emerge sync". Clients which simply
34 have the mount don't need it.
35
36 I also use /etc/portage/mirrors on clients, and have a line like:
37
38 local <URL>
39
40 where <URL> is the path to the directory *above* distfiles, i.e.
41 distfiles should not be in the URL. (This doesn't remove your fetch
42 restriction problems; it is primarily for posterity in the archives,
43 if anyone ever bothers to search them before asking questions.)
44
45 The last thing I do is move the Portage tree in make.conf:
46
47 PORTDIR=/var/portage
48 DISTDIR=/var/cache/distfiles
49 PKGDIR=/var/cache/packages
50 RPMDIR=/var/cache/rpm
51 PORTDIR_OVERLAY=/usr/local/portage
52
53 /var is a much better place for the tree, since it does change a lot.
54 Distfiles and packages always be refetched/rebuilt, so they go in
55 /var/cache; one could argue that the Portage tree belongs there too.
56 Depending on your backup solution, you may be able to avoid backing up
57 /var/cache. For convenience, you can make a symlink from /usr/portage
58 to /var/portage.
59
60 The tree structure I actually use on the Filer/NFS server is:
61
62 gentoo/
63 portage/
64 distfiles/
65 packages/
66 server/
67 pentium3/
68 pentium4/
69 workstation/
70 pentium3/
71 pentium4/
72
73 The important feature here is distfiles and packages are no longer
74 under portage. This makes the NFS exports more manageable.
75
76 I glossed over packages a bit, but you get the general idea. I'm not
77 currently using PORTAGE_BINHOST because things are somewhat in flux at
78 the moment.
79
80 --
81 Computer interfaces should never be made of meat.
82
83 Using GMail? Setting Reply-to address to <> disables this annoying feature.

Replies

Subject Author
Re: [gentoo-server] multiple gentoo boxes, master file fetcher & override fetch restriction Barry Shaw <baz@×××××××××××××××.nz>