I can’t seem to connect two nodes on my macbook pro. I am using
iex —sname foo
and iex —sname bar
in two separate terminal sessions and they can’t see each other. I’ve tried setting the firewall and turning it off completely with no luck.
From foo, I am using Node.self
to see that the full name is :"foo@ewHBook-Pro"
and then from bar, I’m trying both Node.connect :"foo@ewHBook-Pro"
and Node.ping :"foo@ewHBook-Pro"
Hostname resolution is a bit tricky on OSX. Try using long names with --name "foo"
. If that fails, explicitly tell it the hostname you want to use with:
--name "foo@`hostname`"
The name will then be something like :"[email protected]"
and you can use that in Node.connect/1
and Node.ping/1
.
This is likely an issue in your hosts file. Check out this comment by pma on this GitHub issue.
The solution on the issue was using iex --sname foo@localhost
and iex --sname bar@localhost
.
sudo vi /etc/hosts
then add a line
127.0.0.1 macbook
the macbook
is your computer name.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With