From: Eric Hodel Date: 2005-12-08T09:13:39+09:00 Subject: Re: DRb connection issues On Dec 7, 2005, at 1:09 PM, Kevin Brown wrote: > kevin@costarica:~/drbsample$ ruby dchats.rb > druby://costarica.fylz.com:1242 ^^^^^^^^^^^^^^^^^^ > [return] to exit. > > I start the client on the other machine (called nicaragua) and see > this: > > kevin@nicaragua:~/ruby/drb$ ruby dchatc.rb druby:// > costarica.fylz.com:1242 > kevin > > I can ping both machines by name from each other just fine: > kevin@nicaragua:~/ruby/drb$ ping costarica ^^^^^^^^^ > PING costarica.fylz.com (192.168.2.105) 56(84) bytes of data. > 64 bytes from costarica.fylz.com (192.168.2.105): icmp_seq=1 ttl=64 > time=0.226 > ms > > kevin@costarica:~/drbsample$ ping nicaragua ^^^^^^^^^ > PING nicaragua.fylz.com (192.168.2.102) 56(84) bytes of data. > 64 bytes from nicaragua.fylz.com (192.168.2.102): icmp_seq=1 ttl=64 > time=0.206 > ms Your ping host names and druby URI host names do not match. Try ping with the full host name. > Both know their host name: > kevin@nicaragua:~/ruby/drb$ hostname > nicaragua.fylz.com > > kevin@costarica:~/drbsample$ hostname > costarica.fylz.com On each machine try: $ ruby -rsocket -e 'p Socket.gethostname' "kaa.coop.robotcoop.com $ ruby -rsocket -e 'p Socket.gethostbyname("kaa.coop.robotcoop.com")' ["kaa.coop.robotcoop.com", [], 2, "\300\250\001F"] $ ruby -rsocket -e 'p Socket.gethostbyaddr("\300\250\001F")' ["kaa.coop.robotcoop.com", [], 2, "\300\250\001F"] $ ruby -rsocket -e 'p Socket.gethostbyname("rur-1.coop.robotcoop.com")' ["rur-1.coop.robotcoop.com", [], 2, "\300\250\001\v"] $ ruby -rsocket -e 'p Socket.gethostbyaddr("\300\250\001\v")' ["rur-1.coop.robotcoop.com", [], 2, "\300\250\001\v"] Where 'kaa.coop.robotcoop.com' is the local machine and 'rur-1.coop.robotcoop.com' is the remote machine. Line 1 should match `hostname` Lines 2 and 3 should be identical Lines 4 and 5 should be identical In lines 2 through 5 the last item should not match: "\177\000\000\001" Note: "\177\000\000\001".scan(/./).map { |c| c[0] }.join '.' => "127.0.0.1" > And here are the contents of both of their /etc/hosts files: > > kevin@nicaragua:~/ruby/drb$ cat /etc/hosts I would set up DNS instead of relying on hosts files, I've found hosts files fragile. -- Eric Hodel - drbrain@segment7.net - http://segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com