[erlang-questions] OTP & Global Names

Kevin A. Smith <>
Thu Nov 8 15:21:01 CET 2007


That did the trick! Interesting part is I left the nodes up overnight  
and the name never did become available without calling global:sync/0.  
Curious...

--Kevin
On Nov 7, 2007, at 10:25 PM, Jack Orenstein wrote:

> I ran into a similar problem, and used global:sync/0 to make sure  
> that all names were known on all nodes. I'm not positive that this  
> is necessary, or a recommended technique, but it seemed to do the  
> trick.
>
> Jack
>
> On Nov 7, 2007, at 10:16 PM, Kevin A. Smith wrote:
>
>> I've been playing around with OTP a bit and have run into some
>> behavior I'm not understanding.
>>
>> I have two nodes running on my laptop, foo and bar. Node foo is a erl
>> shell started with the -sname parameter. Node bar is also an erl  
>> shell
>> but is started -sname and with a boot script for a very simple OTP
>> application. The app starts two gen_servers, calc and cache. Cache is
>> started with the tuple {local, ?SERVER}. I expect cache to only be
>> visible directly on its node and it is.
>>
>> On the other hand, calc is started with the tuple {global, ?SERVER}.
>> I'd expect calc to be visible via global:registered_names() on node
>> foo. Sadly for me, registered_names() returns an empty list. I've
>> tested and verified basic networking between the two nodes via
>> net_adm:ping() so I believe the nodes can see each other.
>>
>> What have I missed? I can provide copies of my .rel and .app files if
>> it would help diagnose the problem.
>>
>> --Kevin
>> _______________________________________________
>> erlang-questions mailing list
>> 
>> http://www.erlang.org/mailman/listinfo/erlang-questions
>




More information about the erlang-questions mailing list