User:Goverp/ClientServerGentoo

Gentoo is a meta-distribution, which makes it easy to share a custom Gentoo Linux across more than one computer. This can be done in several ways; this document describes one of them. It may or may not be the most appropriate for any particular situation. If it is appropriate, it will allow different but similar computers to share the same packages where possible, while allowing for different packages when necessary.

The approach described allows one computer to do the majority the "heavy lifting" of compiling the packages, and in most cases the other computers just install the compiled code. Gentoo's handling of binary hosts makes this very simple to set up and administer.

Concepts and Facilities
This document describes one way to use a binary package host. The Binary package guide contains reference details of the Gentoo facilities being used.

One computer will be the Master - your personal distribution's binary package host. The other computers will be Slaves, which will usually install compiled packages from the master. The slave can compile its own packages where the master either doesn't have the package, or it's unsuitable for the slave; Gentoo sorts this out automatically.

The approach uses NFS and/or Rsync to transfer packages between the master and slaves.

Matching processor architectures
The approach works when the master and slaves are reasonably similar; for example, the master could be an old but powerful desktop computer with a 4-way AMD Phenom processor, lots of memory and a large RAID disk array, while a slave might be a laptop with a later but smaller AMD a9-9420 processor. It turns out that in most cases code for the Phenom runs well on the a9-9420, and magically, Gentoo can identify the cases where it doesn't and this approach will lead to the slave compiling its own custom code.

It does not work when the architectures are dissimilar, for example an Intel master and an ARM slave such as a Raspberry Pi. Intel code simply does not run on ARM chips.

It might not work if the master has a later version of the similar architecture; for example, an a9-9420 master and a Phenom slave, unless you compromise by restricting code to the older architecture. This combination is untried; it might work just as well as the other way round, or not. For more details, see for a discussion.

Matching implementation profiles and USE flags
Gentoo's greatest feature is its customization.. The approach allows for differing and  settings for master and slaves; Gentoo will allow a slave to use master code for packages with the same settings while compiling different code where the settings differ.

Since Gentoo profiles are largely a set of default USE flags, if the master has a different profile to the slave there may be many different USE settings between the two machines. This may mean the majority of packages have to be recompiled for the slave, negating the benefits of the master/slave approach.

Installation
The master and slave machines may share the same portage tree over NFS. This saves the slave from carrying the portage tree, and saves having to process. However, in this case it's impossible to run any commands on the slave when not connected to the master.