exploring-elixir icon indicating copy to clipboard operation
exploring-elixir copied to clipboard

Error on Episode 7 when running cluster with Libcluster

Open sdia-zz opened this issue 7 years ago • 1 comments

Hello @aseigo ,

first of all, thank you for the Elixir episodes channel on Youtube. I am a subscriber and I thumb upped many of your videos :-))

So I am running into the error above when trying to start a cluster using Libcluster. Do you have any idea? I am running on Mac OS X High Sierra.

I tried to change port in config/libclluster.iex, I even deleted ~/.erlang.cookie....

Any insight is appreciated! Thank you a lot!

$~/src/exploring-elixir$ iex --sname node3 -S mix
Erlang/OTP 20 [erts-9.3.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
 
Interactive Elixir (1.6.5) - press Ctrl+C to exit (type h() ENTER for help)
iex(node3@deupc00033)1> ExploringElixir.AutoCluster.start
start/0    
iex(node3@deupc00033)1> ExploringElixir.AutoCluster.start
Starting node monitor process
********** Visible Nodes **********
Not connected to any cluster. We are alone.
{:error,
 {:libcluster,
  {{:shutdown,
    {:failed_to_start_child, Cluster.Strategy.Gossip,
     {{:badmatch, {:error, :eaddrinuse}},
      [
        {Cluster.Strategy.Gossip, :init, 1,
         [file: 'lib/strategy/gossip.ex', line: 56]},
        {:gen_server, :init_it, 2, [file: 'gen_server.erl', line: 365]},
        {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 333]},
        {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}
      ]}}}, {Cluster.App, :start, [:normal, []]}}}}
iex(node3@deupc00033)2> [info] Application libcluster exited: Cluster.App.start(:normal, []) returned an error: shutdown: failed to start child: Cluster.Strategy.Gossip
    ** (EXIT) an exception was raised:
        ** (MatchError) no match of right hand side value: {:error, :eaddrinuse}
            (libcluster) lib/strategy/gossip.ex:56: Cluster.Strategy.Gossip.init/1
            (stdlib) gen_server.erl:365: :gen_server.init_it/2
            (stdlib) gen_server.erl:333: :gen_server.init_it/6
            (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
[info] Application poison exited: :stopped

sdia-zz avatar May 25 '18 20:05 sdia-zz

Known issue on MacOS X where UDP does not like to share the same port. I have to look into what can be done about that, though I don't have a MacOS system to test on.

I may do another episode on clustering with some of the new features that are available in recent OTP releases, and if / when I do then I will also probably bump the libcluster demo to use something other than UDP gossip.

Thanks for the report!

aseigo avatar May 30 '18 09:05 aseigo