bitwalker/libcluster

After upgrade from 2.x to 3.x I stopped receiving heartbeats with Gossip strategy

sgessa opened this issue · 6 comments

After upgrading to OTP 21, my libcluster version was broken.
Using version 3.0.2 I'm not receiving heartbeats anymore and the cluster is not formed.
Testing on localhost with default libcluster config in a phoenix project with swarm and distillery.

Using 2.5.0 works, after replacing :net_kernel.connect/1 with :net_kernel.connect_node/1

What strategy are you using?

It was in the title, Gossip.

@sgessa I ran into the same problem when I installed the 3.0.2 version of libcluster but I explicitly added this line to the supervised children process in the main supervisor.

{Cluster.Supervisor, [topologies, [name: MyApp.ClusterSupervisor]]}

so I looks like this

  def start(_type, _args) do
    import Supervisor.Spec

    children = [
      {Cluster.Supervisor, [Application.get_env(:libcluster, :topologies), [name: MyApp.ClusterSupervisor]]}
    ]

    opts = [strategy: :one_for_all, name: MyApp.Supervisor]
    Supervisor.start_link(children, opts)
  end

Hope this helps!

When you upgraded from 2 to 3, did you perform the same step that @akosipc did? The usage of libcluster has changed, hence the major version bump.

Sorry I didn't realize the usage has changed. It works.