Distcc Setup

From CDOT Wiki
Revision as of 18:04, 29 January 2009 by Jtpau (talk | contribs) (Assigned machine)
Jump to: navigation, search

Task Name

Setting up distcc, distributed compilation for c/c++ compilers on Linux machines in CDOT.

Task Description

The goal is to eventually set up distcc on all Linux boxes in CDOT, so compiling on any of the computers is distributed on all others.


DistCC Cross-compiling Guide
Frequently asked questions
Linux Knowledge Base: DistCC
DistCC User Manual
Deaseon Moon's Blog
(add more)

Assigned machine

  • Ireland ( - Tested & Working - Frankie Law (irc Mini_Cheong), Daeseon Moon (irc daeseon)
  • Germany ( - Tested & Working - Andrew Braini(aBraini)
  • Australia ( - Tested & Working - Fred Wang (WFred)
  • China ( - Tested & Working - Aaron Chan (achan66)
  • Liberia ( - Tested & Working - Ladan Zahiroleslam (irc: l_zahir, LZahir)
  • Hongkong ( - Jerry Pau (jPau)
  • India ( - Tested & Working - Ryan Wang (rmwang), Tiago Moreira (Kamots)


  • India
    • network connection went down again around 2pm, could not complete distcc setup --- Tiago
    • Ran through tutorial on Australia and it seemed good. I managed to compile Apache --- Tiago
  • China
    • tried like 6 times from the beginning to follow the steps provided to do distcc, but for some reason it says /etc/distcc/hosts did not contain any
    • hosts - i tried editing the file itself and the file "/etc/sysconfig/iptable" manually, yet distcc still fails. I tried to do the setup both on india
    • and china, since I thought it needed both client/server interaction at the same time. I probably need an example setup shown to me face to face
    • Aaron
  • Germany
    • distccd user created, hosts file setup, tested and working on Thu 29 Jan, 2009 --- ABraini
  • Australia
    • distccd is running under distcc account
      • hosts file setting done
      • user "distcc" created for running distccd. --- Daeseon Moon
  • Hong Kong
    • tested and works with China as the client
    • tested and works with India as the client
      • India is so much faster than China. It was like using high speed internet for the first time --- Jerry Pau

distcc Setup Steps


To install distcc using yum log on as root "su -" and type “yum search distcc”. Two packages available, install both to run as both client and server. At prompt type “yum install distcc-server” to install server package and “yum install distcc” for client package.


Create a new user the daemon will run under without a home dir or workgroup

$ adduser distcc -N -M 

Start the distcc daemon

$ distccd --daemon --user distcc --allow

Argument --user is if distccd gets executed as root, change to user USER, --allow IPADDR[/MASK] instructs distccd to accept connections from the IP address. A CIDR mask length can be supplied optionally after a trailing slash, e.g., in which case addresses that match in the most significant MASK bits will be allowed.

Now we need to setup the IPTABLES to allow connections to the distcc daemon. Before doing anything make a backup file of the original iptables file located in /etc/sysconfig/iptables.

$ cp /etc/sysconfig/iptables [backupfile name]
$ iptables -I INPUT 7 -i eth0 -p tcp -s --dport 3632 -j ACCEPT
$ service iptables save 
  • Important Note: It seems the -I INPUT 7 argument is confusing a lot of people. -I INPUT 7 was used in Daeson's case for the machine he was working on at the time, however this may not be the same for all machines. In Daeson's case there was a REJECT line in the INPUT CHAIN at line 8. So in order for us to get our port open we need to insert ie. -I into the INPUT CHAIN at line 7 before the REJECT line. On Machines with an INPUT CHAIN shorter then 7 lines this will cause an error. On machines without a REJECT line a simple "-A" appened aurgument can take the place of "-I INPUT 7". On a machine with a REJECT INPUT on a line before 8 you simply need to change the number to one smaller as long as it is before the REJECT line.

Argument -I is insert and -i is and network interface device and -p is protocol -s is source ipaddress and subnet, –dport is destination port and -j is rule.

On the client machine the server names need to be added to the hosts listed in the file located at


To close/shut down the daemon (do not unless needed)

$ service distccd stop


Open two SSH connections into the client machine.

In Terminal 1 enter:

$ distccmon-text 1

In Terminal 2 enter:

$ wget http://apache.mirror.rafal.ca/httpd/httpd-2.2.11.tar.gz
$ tar xzvf httpd-2.2.11.tar.gz
$ cd httpd-2.2.11
$ CC=distcc ./configure
$ make -j9 CC=distcc >log 2> error 

(complete this collaboratively) TO-DO

  • hosts saved in hosts file
  • better formatting
  • creating new distccd user with no home-dir for daemon
  • things forgotten or left out.

How to compile with distcc