I try to run my application on two nodes on one maschine: https://dockyard.com/blog/2016/01/28/running-elixir-and-phoenix-projects-on-a-cluster-of-nodes
I created config file:
[{kernel,
[
{sync_nodes_optional, ['n1@127.0.0.1', 'n2@127.0.0.1']},
{sync_nodes_timeout, 10000}
]}
].
I run (from terminal 1):
elixir --name n1@127.0.0.1 --erl "-config sys.config" -S mix phoenix.server
and then (from terminal 2):
elixir --name n2@127.0.0.1 --erl "-config sys.config" -S mix phoenix.server
and I receive:
** (Mix) Could not start application app: App.start(:normal, []) returned an error: shutdown: failed to start child: App.Endpoint
** (EXIT) shutdown: failed to start child: Phoenix.Endpoint.Server
** (EXIT) shutdown: failed to start child: {:ranch_listener_sup, App.Endpoint.HTTP}
** (EXIT) shutdown: failed to start child: :ranch_acceptors_sup
** (EXIT) {:listen_error, App.Endpoint.HTTP, :eaddrinuse}
What I'm doing wrong ?