[erlang-questions] Gproc in a dynamic cluster

Ulf Wiger ulf.wiger@REDACTED
Mon Aug 1 16:00:49 CEST 2011


If you are using the Abecciu fork of gen_leader (http://github.com/abecciu/gen_leader_revival.git), you can start gproc with an explicit list of nodes. 

When adding a new candidate, you need to add it to the 'candidates' option via gproc, and also name one of the existing (and running) candidates as "seed node", using {seed, SeedNode}. This is undocumented, but the algorithm is sketched here:

https://gist.github.com/499825

The gen_leader leader instance will trigger a candidate list update for all candidates, and the gproc dictionary will be automatically synched.

This could all be baked into the 'all' option somehow. I'll think about that.

BR,
Ulf W

On 1 Aug 2011, at 13:47, Mihai Balea wrote:

> That is correct, however, I was wondering if there's a way to make gproc aware of nodes that are added at a later time.
> 
> On Jul 31, 2011, at 4:51 PM, Tino Breddin wrote:
> 
>> Hi,
>> 
>> When using 'all' gproc_dist passes the list of nodes in the current cluster to gen_leader. Therefor in both cases you are only starting gproc_dist with 1 candidate node since you only connect them later.
>> 
>> T
>> 
>> On Jul 29, 2011, at 11:19 PM, Mihai Balea wrote:
>> 
>>> Hi all,
>>> 
>>> Here's a scenario:
>>> - start Node1
>>> - start gproc in global mode on node 1 (via {gproc, [{gproc_dist, all}]} in app.config)
>>> - start Node2
>>> - start gproc in global mode on node 2 (same way)
>>> - connect the two nodes in a cluster, via net_adm:ping/1
>>> 
>>> The two nodes see each other, as expected, but the two instances of gproc don't seem to be aware of each other's presence - global registrations done on one node are not visible on the other side.
>>> 
>>> Am I missing something? Is there a way to make gproc aware of new nodes in a cluster, either automatically or manually?
>>> 
>>> Thanks in advance,
>>> Mihai
>>> 
>>> _______________________________________________
>>> erlang-questions mailing list
>>> erlang-questions@REDACTED
>>> http://erlang.org/mailman/listinfo/erlang-questions
>> 
>> 
>> 
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

Ulf Wiger, CTO, Erlang Solutions, Ltd.
http://erlang-solutions.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110801/853fe7e0/attachment.htm>


More information about the erlang-questions mailing list