Closed brainlid closed 3 years ago
I found my problem. The application setup wasn't correct.
{Horde.Registry, [name: Tictac.GameRegistry, keys: :unique, members: :auto]},
{Horde.DynamicSupervisor, [name: Tictac.DistributedSupervisor, strategy: :one_for_one, members: :auto]},
I was missing the members: :auto
on Horde.Registry
. It was unclear from the documentation I was reading that this was needed. As I dug further into the registry docs, I realized that it also had this flag option.
So it's working! Yay!
Thank you for the library!
This is not a timing issue. It doesn't sync ever. At least not how I'd expect.
Version: 0.8.3 Horde Experience Level: Trying out horde for the first time Expectation: Creating a new GenServer through the supervisor gets registered in the Horde Registry and is accessible on multiple nodes in the cluster. Behavior Observed: The GenServer gets created (maybe even on the other other node from the execution), but the Registry on the non-owning node never gets the entry registered.
I have a very simple app. Here's the
application.ex
config.NOTE:
members: :auto
is used.It is using
libcluster
. When locally creating two nodes that are clustered together. I can verify they are clustered.Starting the nodes like this:
Shows they are clustered together.
I have a simple GenServer that follows the example given here.
When I create a new GenServer, it correctly creates the instance and registers it on one of the nodes.
Running the same command from the remote node (where the process was created).
Notice that the first returned PID is on the remote node. When I do the Registry lookup, it works when it is on the local node. Even after waiting many minutes, the node it was not created on will not find the entry. This means I'm unable to find or send messages to the GenServer.
Here's the GenServer module.
I would expect the created GenServer to be returned on all nodes when using
Horde.Registry.lookup(Tictac.GameRegistry, "ABCD")
. But even after many minutes, it never syncs to the other node. It will return on the hosting/local node, but not the other/remote one.I did note that when I kill the node hosting the server, it is moved to the remaining server and then the lookup works. This shows that the clustering is all working, but for me the registry lookup is not working.