[erlang-questions] Global names initialisation

Jan Henry Nystrom jan@REDACTED
Mon Jun 18 09:08:55 CEST 2007


Kirill Zaborski wrote:
> But then I need to run this function...
> As I see now (from OTP Design Principles /Distributed Aplications) I
> can use 'distributed' parameter adn specify the needed nodes but then
> I need some application to distribute. And in my app I only need it to
> be accesible and also I'd like to connect nodes dynamically.
> So the only way is to run net_kernel:connect_node/1 manually?
Well Kirill, from what I understand of your description, yes.
The dynamic adding and removing of node requires the explicit
connecting of those nodes, either through net_kernel/1 or
by explicit use of the node-name.

/Cheers Henry

> 
> Regards,
> Kirill.
> 
> On 6/18/07, Jan Henry Nystrom <jan@REDACTED> wrote:
> Kirill Zaborski wrote:
>> > For my application I need to register "central" service with a global
>> > name. I do this using {gobal, server_name} in gen_server:start_link/4
>> > Registration goes OK but when I start other node on the same host using
>> > different -sname parameter I get an empty list from
>> > global:registered_names/0. If I connect to the "main" node with
>> > net_adm/ping then I see the desired global name.
>> > I there any way to get this right from the start?
>> Yes, connect from the start. The global library is implemented in
>> Erlang and uses nodup and nodedown messages from net_kernel to
>> keep track of nodes coming and going. BTW, to connect explicitly
>> net_kernel provides the function connect_node/1.
>>
>> /Cheers Henry
>>
>>
>> >
>> > Regards,
>> > Kirill.
>> >
>> >
>> > 
>> ------------------------------------------------------------------------
>> >
>> > _______________________________________________
>> > erlang-questions mailing list
>> > erlang-questions@REDACTED
>> > http://www.erlang.org/mailman/listinfo/erlang-questions
>>
>>
>> -- 
>> Jan Henry Nystrom
>> Training Manager
>>
>> Erlang Training and Consulting Ltd
>> 401 Fruit and Wool Exchange,
>> Brushfield Street, London,
>> E1 6EL, United Kingdom
>> Company Registration 3893360 VAT Number GB 752 1091 57
>> Tel +44 207 456 1020
>> Fax +44 870 1390 779
>> jan@REDACTED
>>


-- 
Jan Henry Nystrom
Training & Research Manager @ Erlang Training and Consulting Ltd
jan@REDACTED



More information about the erlang-questions mailing list