[erlang-questions] Global names initialisation
Jan Henry Nystrom
jan@REDACTED
Mon Jun 18 10:02:55 CEST 2007
Kirill Zaborski wrote:
> Thanks!
> It looks like documentation isn't correct in
> http://www.erlang.org/documentation/doc-5.5.4/lib/kernel-2.11.4/doc/html/init.html#flags
The documentation is correct. It just incomplete, and probably always
will be since different shells do slightly different things with
quoting added to how the reader deals with quotes a complete
description would be rather long.
/Happy hacking Henry
>
> I thought I should use single quotes and that was clearly wrong.
> Now everything works OK.
>
> Regards,
> Kirill.
>
> On 6/18/07, Jan Henry Nystrom <jan@REDACTED> wrote:
> 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
>>
>> [azatoth] jann>erl -name bar@REDACTED
>> Erlang (BEAM) emulator version 5.5.2 [source] [async-threads:0] [hipe]
>> [kernel-poll:false]
>>
>> Eshell V5.5.2 (abort with ^G)
>> (bar@REDACTED)1>
>>
>> and in another shell:
>>
>> [azatoth] jann>erl -name foo@REDACTED -eval
>> "net_kernel:connect_node('bar@REDACTED')."
>> Erlang (BEAM) emulator version 5.5.2 [source] [async-threads:0] [hipe]
>> [kernel-poll:false]
>>
>> Eshell V5.5.2 (abort with ^G)
>> (foo@REDACTED)1> nodes().
>> ['bar@REDACTED']
>> (foo@REDACTED)2>
>>
>>
>>
--
Jan Henry Nystrom
Training & Research Manager @ Erlang Training and Consulting Ltd
jan@REDACTED
More information about the erlang-questions
mailing list