Empty node list in simple Distributed Haskell / Cloud Haskell example

57 Views Asked by At

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?

2

There are 2 best solutions below

0
On BEST ANSWER

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.

0
On

Try giving actual IP of your machine instead of localhost. It worked on my machine.

➜  ~ ./minimal-example slave 192.168.1.104 8082 &
[1] 710
➜  ~ ./minimal-example slave 192.168.1.104 8081 &
[2] 715
➜  ~ ./minimal-example slave 192.168.1.104 8083 &
[3] 720
➜  ~ ./minimal-example master 192.168.1.104 8084 &
[4] 725
➜  ~ Slaves: [nid://192.168.1.104:8081:0,nid://192.168.1.104:8082:0,nid://192.168.1.104:8083:0]