Search code examples
haskelldistributed-computingcloud-haskell

Empty node list in simple Distributed Haskell / Cloud Haskell example


I am trying to follow the simple example in the official docs, but when I run:

./example slave localhost 8080 &
./example slave localhost 8081 &
./example slave localhost 8082 &
./example slave localhost 8083 &
./example master localhost 8084

What I expected:

Slaves: [nid://localhost:8083:0,nid://localhost:8082:0,nid://localhost:8081:0,nid://localhost:8080:0]

What I see:

Slaves: []

What am I doing wrong?


Solution

  • It turns out that the slaves were binding to IPv6 localhost instead of IPv4:

    ͳ ss -nlp '( sport = 8080 or dport = 8080 )'
    Netid             State               Recv-Q              Send-Q                            Local Address:Port                           Peer Address:Port              
    tcp               LISTEN              0                   128                                       [::1]:8080                                   [::]:* 
    

    Telling them to bind to 127.0.0.1 in place of localhost does the trick.