[erlang-questions] Global names initialisation
Jan Henry Nystrom
jan@REDACTED
Mon Jun 18 09:30:36 CEST 2007
Kirill Zaborski wrote:
> I thought that could solve this problem by running
> net_kernel:connect_node in erl init. I've tried -eval, -run, -s with
> no success.
> It seems that net_kernel starts later than this initialisation steps.
> Am I right?
No. From the attached file you can see how I called net_kernel(my
email client ha rather peculiar ideas about line breaks hence the
inclusion of the file since the command is rather sensitive to such).
/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
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: kirill.txt
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20070618/f24ee2f8/attachment.txt>
More information about the erlang-questions
mailing list