Holumbus Distributed Across a Home Network

Installing

With GHC-6.12.1 running (I didn’t have this problem on another computer running 6.10. It could also be caused by different library versions)

$>cabal install holumbus-distributed

fails with the error

source/Holumbus/Common/FileHandling.hs:90:75:
    Ambiguous occurrence `utf8'
    It could refer to either `System.IO.utf8', imported from System.IO at source/Holumbus/Common/FileHandling.hs:73:0-25
                          or `Text.XML.HXT.Arrow.utf8', imported from Text.XML.HXT.Arrow at source/Holumbus/Common/FileHandling.hs:76:0-34

source/Holumbus/Common/FileHandling.hs:100:53:
    Ambiguous occurrence `utf8'
    It could refer to either `System.IO.utf8', imported from System.IO at   source/Holumbus/Common/FileHandling.hs:73:0-25
                          or `Text.XML.HXT.Arrow.utf8', imported from Text.XML.HXT.Arrow at source/Holumbus/Common/FileHandling.hs:76:0-34
cabal: Error: some packages failed to install:
Holumbus-Distribution-0.0.1.1 failed during the building phase. The exception
was:
ExitFailure 1

This is easily fixed by downloading the sources and hiding utf8 in the import of System.IO. In the file source/Holumbus/Common/FileHandling.hs change

import System.IO

to

import System.IO hiding (utf8)

then run cabal install You need to get this stuff installed on every computer you want to use (unless you can copy working binaries between them)

Network Configuration

Every computer needs to be able to find every other computer by hostname. You can setup a DNS server to do this but since I am working on a small scale I think that would be overkill. Instead I edited the /etc/hosts file on each of my computers. The file on this computer looks like:

#
# /etc/hosts: static lookup table for host names
#

#<ip-address>   <hostname.domain.org>   <hostname>
127.0.0.1               localhost.localdomain   localhost GlAsDOS
192.168.1.4             HAL
# End of file

The /etc/hosts file on HAL must tell HAL how to find this computer (GlAsDOS; unoriginal naming scheme I know).

You may want to configure your router to use static IPs for these machines so that you don’t have to keep changing the /etc/hosts file.

Let’s Go!

Compile the two example programs on the Holumbus Distributed site. I called one of them “speak” and the other “listen”. I compiled them both on each computer although if you are confident that everything will work first time you only need one on each.

Then run

$>PortRegistry

in a terminal on one of your machines. At first I didn’t realise that this program needs to keep running the whole time you are using your distributed system.

PortRegistry will create a file /tmp/registry.xml. This needs to be duplicated onto all the machines you want to use.

Now you are ready to go. Run the program “listen” on one of your machines and the program “speak” on another. “speak” should terminate pretty much straight away whilst “listen” terminates after printing “Hello World” to sdout.