View previous topic :: View next topic |
Author |
Message |
Letharion Veteran
Joined: 13 Jun 2005 Posts: 1344 Location: Sweden
|
Posted: Thu Feb 12, 2009 11:12 am Post subject: Can several computers be both server/client for distcc? |
|
|
I have 3 gentoo boxes, and trying to get distcc to work, but I seem to be doing something wrong.
After looking around in the forums, I saw someone mentioned that maybe a computer can't be box server and client to distcc. Is that so?
None of the computers are very slow, but I'd like all of them to help eachother out when compiling, if possible.
Is that configuration even possible, to begin with? |
|
Back to top |
|
|
magic919 Advocate
Joined: 17 Jun 2005 Posts: 2182 Location: Berkshire, UK
|
Posted: Thu Feb 12, 2009 5:49 pm Post subject: |
|
|
I haven't run this for a while, but one of my machines was the server and also ran as one of the clients too. |
|
Back to top |
|
|
VinzC Watchman
Joined: 17 Apr 2004 Posts: 5098 Location: Dark side of the mood
|
Posted: Thu Feb 12, 2009 5:49 pm Post subject: |
|
|
Distcc is invoked only when compiling. I.e. a machine can be compiling and make remote DISTCC calls while configured to serve DISTCC requests. Only DISTCC configuration will tell to what remote host(s) to send requests. So, yes, a machine can be a DISTCC server and client as well. _________________ Gentoo addict: tomorrow I quit, I promise!... Just one more emerge...
1739! |
|
Back to top |
|
|
Letharion Veteran
Joined: 13 Jun 2005 Posts: 1344 Location: Sweden
|
Posted: Thu Feb 12, 2009 7:51 pm Post subject: |
|
|
So then it SHOULD work Ok, thanks. At least one of the machines is now giving "unable to distribute", so something is now working ^^ |
|
Back to top |
|
|
Mben Guru
Joined: 29 Mar 2004 Posts: 465 Location: New York, USA
|
Posted: Thu Feb 12, 2009 11:20 pm Post subject: |
|
|
I've successfully run a setup similar to what you want using distcc over ssh (on RedHat, but there's no reason it wouldn't work on Gentoo).
Something to consider (depending on your network setup):
if you set DISTCC_HOSTS to a list like "localhost/n @remote1/n @remote2/n" where n is the number of processes that machine should run distcc will connect to your remote hosts via ssh (no need to run the server on each machine). There is some performance hit for this, but I doubt it's significant for reasonably fast machines and it may be easier to manage. Since all the machines I'm working with share most of their filesystems it is in my case.
I haven't had a problem with the local machine being listed twice (as localhost and something else) but it probably wouldn't hurt to substitute localhost for the appropriate machine in the list on a per machine basis.
Just be sure to setup preshared ssh keys first.
Sometimes it helps to symlink distcc to gcc/g++, etc though portage seems to take care of this reasonably well if I remember correctly (it's been a few years since I've ran distcc on my Gentoo box). |
|
Back to top |
|
|
kimmie Guru
Joined: 08 Sep 2004 Posts: 531 Location: Australia
|
Posted: Wed Feb 18, 2009 1:56 pm Post subject: |
|
|
There's no problem having distcc as a server and client.
For a server you need to run distccd, and set up /etc/conf.d/distccd with the correct --listen or --allow to let your clients talk to it.
To use it as a client with portage you need to have the correct settings in make.conf; here are bit from mine.
Code: | FEATURES="distcc ..."
# Bump this up if using distcc... about 2x(avail CPUs) works for me
MAKEOPTS=-j8
# Only setting really needed here is
#DISTCC_LOG="$PORT_LOGDIR/distcc.log"
#DISTCC_VERBOSE=0
DISTCC_HOSTS="localhost goblin.localnet"
#DISTCC_DIR="/tmp/portage-distcc"
|
To use distcc as a client outside portage you are supposed to use distcc-config to setup /etc/env.d/02distcc... but it didn't work for me. So I added my own /etc/env.d/02distcc.local:
Code: | $ cat /etc/env.d/02distcc
# This file is managed by distcc-config; use it to change these settings.
DISTCC_LOG=""
DCCC_PATH="/usr/lib/distcc/bin"
DISTCC_VERBOSE="0"
$ cat /etc/env.d/02distcc.local
# This file is managed by distcc-config; use it to change these settings.
# ^^^ above message from /etc/env.d/02distcc
# is a complete lie... distcc-config is broken - gid 7/7/8
# This is supposed to be 02distcc, put it in 02distcc.local so it doesn't get overwritten
DISTCC_DIR=/tmp/.distcc-global
DISTCC_HOSTS="localhost goblin.localnet"
|
If you use the env.d method you don't need the DISTCC_ settings in make.conf (unless you want to override). But don't forget env-update and relogin to pick up environment changes. |
|
Back to top |
|
|
|