ktanev

ktanev

More than 2 nodes don't connect

I’m still learning Elixir, Phoenix and Mnesia, so probably it is a newbie question.

What I am trying to achieve is running 3 nodes on different IPs and connect them. I am executing on three terminals
PORT=4001 iex --name n1@127.0.0.1 --cookie secret_cookie -S mix phx.server
PORT=4002 iex --name n2@127.0.0.5 --cookie secret_cookie -S mix phx.server
PORT=4003 iex --name n3@127.0.0.8 --cookie secret_cookie -S mix phx.server.

The problem is that the second and third node do not connect to each other and giving me a warning
[warn] global: :"n2@127.0.0.5" failed to connect to :"n3@127.0.0.8". Running Node.ping returns :pang on both, the second and third one.

I have tried running it on the same IPs and it works, so I suppose there should be something more to do in order for them to connect to each other.

Marked As Solved

hauleth

hauleth

On macOS all other addresses in 127.0.0.0/8 are unbound and you need to manually bound them to the lo0.

Also Liked

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

I’m on OS X so perhaps it’s an OS X thing? Regardless, the OP should make sure that the IPs they’re using are addressable in the general sense. If they are not, that’s probably the issue. If they are, then we know to look elsewhere for a solution to their problem.

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Unless regular ping 127.0.0.5 works and routes to your local computer, you probably want all of those nodes to be on 127.0.0.1.

Where Next?

Popular in Questions Top

New
Kurisu
For example for a current url like http://localhost:4000/cosmetic/products?_utf8=✓&query=perfume&page=2, I would like to get: ...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lists...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

Other popular topics Top

danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29377 241
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
marick
I had some trouble figuring out how to make many-to-many associations work. Once I got it working, I wrote a blog post. Because I’m a nov...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New

We're in Beta

About us Mission Statement