Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
distcc fails to distribute, localhost connection refused
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
nomadicME
n00b
n00b


Joined: 24 Mar 2012
Posts: 46

PostPosted: Mon Mar 11, 2013 11:26 pm    Post subject: distcc fails to distribute, localhost connection refused Reply with quote

I'm stymied by this one. Hopefully someone can help.

I have a helper box 192.168.2.8 and two primary boxes 192.168.2.4 & 192.168.2.5. I have configured the two primary boxes identically (as far as I can tell) with the exception of their differing ips. From 192.168.2.5 I can run emerge and it distributes to the helper box and everything works fine. However, from 192.168.2.4 I try the same thing and I get:

Code:

distcc[6539] ERROR: nonblocking connect to 127.0.0.1:3632 failed: Connection refused
distcc[6539] Warning: failed to distribute /home/username/data/overflow/var/tmp/portage/dev-python/python-exec-0.2/work/python-exec-0.2/src/python-exec-c.c to 127.0.0.1, running locally instead


I don't know why it is even trying to distribute to the localhost. I have set the hosts list in two places and both lists only contain the helper's ip:
Code:

distcc-config --set-hosts "192.168.2.8" (this is verified with distcc-config --get-hosts)
export DISTCC_HOSTS='192.168.2.8' (this is verified with distcc --show-hosts)


Here are the contents of /etc/conf.d/distccd:
Code:

# /etc/conf.d/distccd: config file for /etc/init.d/distccd

DISTCCD_OPTS=""

# this is the distccd executable
DISTCCD_EXEC="/usr/bin/distccd"

# this is where distccd will store its pid file
DISTCCD_PIDFILE="/var/run/distccd/distccd.pid"

# set this option to run distccd with extra parameters
# Default port is 3632.  For most people the default is okay.
DISTCCD_OPTS="${DISTCCD_OPTS} --port 3632"

# Logging
# You can change some logging options here:
# --log-file FILE
# --log-level LEVEL  [critical,error,warning, notice, info, debug]
#
# Leaving --log-file blank will log to syslog
# example: --log-file /dev/null --log-level warning
# example: --log-level critical

# DISTCCD_OPTS="${DISTCCD_OPTS} --log-level critical"
# DISTCCD_OPTS="${DISTCCD_OPTS} --log-level warning --log-file /var/log/distcc.log"
DISTCCD_OPTS="${DISTCCD_OPTS} --log-level debug --log-file /var/log/distcc.log"

# SECURITY NOTICE:
# It is HIGHLY recomended that you use the --listen option
# for increased security. You can specify an IP to permit connections
# from or a CIDR mask
# --listen accepts only a single IP
# --allow is now mandatory as of distcc-2.18.
# example:  --allow 192.168.0.0/24
# example:  --allow 192.168.0.5 --allow 192.168.0.150
# example:  --listen 192.168.0.2
DISTCCD_OPTS="${DISTCCD_OPTS} --allow 192.168.2.8"
DISTCCD_OPTS="${DISTCCD_OPTS} --listen 192.168.2.4"

# set this for niceness
# Default is 15
DISTCCD_OPTS="${DISTCCD_OPTS} -N 15"


Both the helper and 192.168.2.4 have their firewalls turned off. I've read over and over the gentoo docs on distcc including the troubleshooting section.

The log file on the helper shows no sign of communication with the primary box. Just shows that it is listening on 192.168.2.8:3632 and how many jobs it can handle ...

The same thing for the log file on the primary box, except it shows it is listening on 192.168.2.4:3632.

Where is the primary box receiving the direction to connect to localhost instead of the helper? Thanks.
Back to top
View user's profile Send private message
krinn
Advocate
Advocate


Joined: 02 May 2003
Posts: 4237

PostPosted: Mon Mar 11, 2013 11:57 pm    Post subject: Reply with quote

check your /etc/hosts if it's sane (hosts well configure and localhost present and pointing to 127.0.0.1)
and on failure distcc always use localhost as a backup.
Back to top
View user's profile Send private message
nomadicME
n00b
n00b


Joined: 24 Mar 2012
Posts: 46

PostPosted: Tue Mar 12, 2013 1:12 am    Post subject: Reply with quote

krinn, thanks for your reply. I checked /etc/hosts (on schatzi) and everything looks good:

Code:

127.0.0.1       localhost
::1             localhost
192.168.2.4     schatzi
192.168.2.8     rolla


Technically --show-hosts and --get-hosts did return rolla instead of 192.168.2.8, I just didn't want to confuse matters, but hostnames are easier to type. :)

Is there any way to get any more debugging info into the log files? On schatzi I have the logging level set on debug in /etc/conf.d/distccd, and I set $DISTCC_VERBOSE=1. Still this is all I get in /var/log/distcc.log on schatzi after trying to install python-exec:
Code:

distccd[2229] (dcc_setup_daemon_path) daemon's PATH is /usr/i686-pc-linux-gnu/gcc-bin/4.5.4:/bin:/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin
distccd[2229] (dcc_listen_by_addr) listening on 192.168.2.4:3632
distccd[2229] (dcc_standalone_server) 4 CPUs online on this server
distccd[2229] (dcc_standalone_server) allowing up to 6 active jobs
distccd[2230] (dcc_log_daemon_started) preforking daemon started (3.1 i686-pc-linux-gnu, built Jan 27 2013 10:45:40)


Which all comes from starting the daemon. Nothing is written to the log file, when it comes time to distribute the job.
Back to top
View user's profile Send private message
krinn
Advocate
Advocate


Joined: 02 May 2003
Posts: 4237

PostPosted: Tue Mar 12, 2013 8:35 am    Post subject: Reply with quote

check /etc/hosts.allow/deny rules ?
Back to top
View user's profile Send private message
Odward
n00b
n00b


Joined: 21 Mar 2012
Posts: 65

PostPosted: Tue Mar 12, 2013 8:43 am    Post subject: Reply with quote

Sorry if this isn't helpful, but I'm curious if you actually tried setting the IP and not the hostname.
e.g.
Code:
export DISTCC_HOSTS=192.168.2.8 && emerge python-exec


You indicated you exported that variable, but then later stated:
Quote:
Technically --show-hosts and --get-hosts did return rolla instead of 192.168.2.8


I don't know how the hosts file could be correct but still resolving rolla to 127.0.0.1 but for the sake of testing
figured why not suggest actual IPs if you hadn't already.

The distcc man page says it checks, in order, $DISTCC_HOSTS > $DISTCC_DIR/hosts > global hosts. But I
also just tested one of my boxes by making sure to unset DISTCC_HOSTS then moving /etc/distcc/hosts and
I received "Warning: no hostlist is set; can't distribute work" so it didn't even pull 127.0.0.1 from my global
hosts file.
Back to top
View user's profile Send private message
nomadicME
n00b
n00b


Joined: 24 Mar 2012
Posts: 46

PostPosted: Tue Mar 12, 2013 8:46 am    Post subject: Reply with quote

No, no /etc/hosts.allow/deny on any of the three boxes.
Back to top
View user's profile Send private message
nomadicME
n00b
n00b


Joined: 24 Mar 2012
Posts: 46

PostPosted: Tue Mar 12, 2013 9:12 am    Post subject: Reply with quote

Progress! and more symptoms.

Odward, thank you for your suggestion. After switching user to root (su), I executed the command string you provided, and it worked. But then I thought, I just changed two things: (1) changed user (instead of sudo), and (2) exported DISTCC_HOSTS as ip. So I restarted, switched user to root, and executed the emerge command alone after verifying that both distcc --show-hosts and distcc-config --get-hosts returned: rolla and that worked as well. So there is something about my user environment. I noticed earlier today that the configuration of the PATH variable in .bashrc is different between the two primary boxes. Maybe I'll just start with a fresh .bashrc and see how that goes. It is too late tonight to try. I'll report back tomorrow after I've experimented.

Thanks for the help. At least I have a scenario that works now. I just need to work toward getting sudo emerge from my user to work.
Back to top
View user's profile Send private message
nomadicME
n00b
n00b


Joined: 24 Mar 2012
Posts: 46

PostPosted: Tue Mar 12, 2013 8:22 pm    Post subject: Reply with quote

Well this problem continues to stump me. I have an empty ~/.bashrc, this is the contents of ~/.bash_profile:
Code:

# /etc/skel/.bash_profile

# This file is sourced by bash for login shells.  The following line
# runs your .bashrc and is recommended by the bash info pages.
[[ -f ~/.bashrc ]] && . ~/.bashrc


I've logged out and back in, and the problem persists in my user environment. I can immediately su to root and everything works fine. Both host lists verified in each profile before each attempt.

What can cause such behavior?
Back to top
View user's profile Send private message
nomadicME
n00b
n00b


Joined: 24 Mar 2012
Posts: 46

PostPosted: Tue Mar 12, 2013 10:21 pm    Post subject: Reply with quote

I suspect it may be due to the groups that my user is a member of. I will be checking on that in a while and report back. For now I am performing a long overdue upgrade of schatzi, now that I can at least use distcc as root.
Back to top
View user's profile Send private message
Odward
n00b
n00b


Joined: 21 Mar 2012
Posts: 65

PostPosted: Wed Mar 13, 2013 6:58 am    Post subject: Reply with quote

Out of curiosity, if you're still having the same symptoms, what happens if you
Code:
sudo ping -c2 rolla


Does it ping 127.0.0.1 or rolla?

What about as your user?
Root clearly resolved properly since distcc started working as root.
Back to top
View user's profile Send private message
nomadicME
n00b
n00b


Joined: 24 Mar 2012
Posts: 46

PostPosted: Wed Mar 13, 2013 6:29 pm    Post subject: Reply with quote

Thanks for all the ideas. I tried pinging from my user and from sudo within my user env and both resolved rolla to 192.168.2.8.
Back to top
View user's profile Send private message
nomadicME
n00b
n00b


Joined: 24 Mar 2012
Posts: 46

PostPosted: Thu Mar 14, 2013 5:02 am    Post subject: Reply with quote

Well I was just writing to say I was stumped again, when in the middle of that process I found the solution!

Even though distcc --show-hosts and distcc-config --get-hosts both repeatedly listed rolla as the only host, /etc/distcc/hosts contained a single uncommented line: 127.0.0.1

I changed it to 192.168.2.8, and now distcc connects to rolla when emerge is initiated with sudo from within my user environment.

Go figure!

Thanks again for the suggestions.
Back to top
View user's profile Send private message
Fuuzetsu
n00b
n00b


Joined: 20 Jul 2012
Posts: 14
Location: Bath, UK

PostPosted: Mon Mar 18, 2013 6:08 pm    Post subject: Reply with quote

There really needs to be a list of all the places where one can define hosts. This is the second time I'm doing a fresh distcc set-up and once again I've been caught out by the arcane number of config flags and environment variables that need to be set up and that are already set up by default.

Thanks for the mention of /etc/distcc/hosts. I also had localhost in there that I did not desire.
Back to top
View user's profile Send private message
destroyedlolo
Guru
Guru


Joined: 17 Jun 2011
Posts: 412
Location: Close to Annecy

PostPosted: Tue Mar 19, 2013 5:45 pm    Post subject: Reply with quote

I suggest having a look on Avahi / +zeroconf flag : distcc will find itself participants.
Very helpful when machines can be arbitrary up or down as on my home's network.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum