This is a mini-HOWTO for setting up Distcc under Gentoo Linux.
Other helpful resources:
Introduction
Distcc is a wonderful program that allows you to divide the task of compiling items among different comptuers. For example, let's say you have three computers in your home network: two Athlon XP's and an old Pentium Classic. It would be painful to compile X on the Pentium when installing Gentoo. distcc allows you to let the two faster computers contribute extra CPU cycles to help the old computer along. I could go into more details, but they are outside the scope of this document. This mini-HOWTO is very simlified and there are many other options for playing with distcc that can be found online. Hopefully this will be enough to get you started.
Getting started
First, we need to emerge the following:
# emerge -p distccThis will give you the server, distccd, and the client, distcc, programs.
Configuring
First, we'll need to edit /etc/make.conf and add a few options.
MAKEOPTS="-jN"
FEATURES="distcc"
"N" is the number of CPU's (usually the number of computers) that are going to use distcc plus 1. So, in the example above, with three computers, N would be 4.
Next, we need to add the list of host computers that we will be using.
# distcc-config --set-hosts "localhost computer1 computer2"where 'computer1' and 'computer2' are the fully qualified hostnames of the other computers that will be using distcc.
Running the daemon
So that you don't have to start up the distcc daemon all the time, add it's init script to the default run level.
# rc-update add distccd defaultThen, go ahead and fire it up.
# /etc/init.d/distccd start
Finishing up
That's it! You should be ready to start using the program now. You can check to make sure the distccd processes are running by doing 'pidof distccd' and making sure there are a few processes associated with the daemon. You should repeat the steps above for all the computers that you would like to be using distcc. Then, just emerge whatever you would like. You can check to see if things are working during the 'make' process by doing,
# netstat -n 1 | grep ip.of.client.machineYou should see traffic between the client and host machine(s) indicating that they are sharing the compiling load.
This concludes the Distcc mini-HOWTO. Any questions can probably be answered by asking Google (and especially Google Groups) or by emailing me at jtoscano at gmail.com.
Author: Joe Toscano (2004)