[erlang-questions] [erlang-patches] Running mnesia across a firewall

Ulf Wiger (TN/EAB) ulf.wiger@REDACTED
Wed Mar 5 13:26:16 CET 2008


Serge Aleynikov skrev:
> Ulf Wiger (TN/EAB) wrote:
>> Serge Aleynikov skrev:
>>>
>>> The main culprit is the net_kernel's dist_auto_connect option that is 
>>> an all or none setting that cannot vary depending on connecting 
>>> attempt to a given node.  The attached patch (for R12B-1) solves this 
>>> issue by introducing an additional kernel option:
>>>
>>>     {dist_auto_connect, {callback, M, F}}
>>
>> Have you thought about solving it with an application that
>> periodically tries calling net_kernel:connect(Node)?
> 
> On which node, though?  If this is one of the "master" nodes A holding a 
> disk copy of a table X, then the node must have {dist_auto_connect, 
> once} set.  If the firewall prohibits inbound access to this node A from 
> some other node C that uses remote mnesia interface to access table X, 
> then the only way to establish connection to node C is to do on node A 
> net_kernel:connect(C).  However if that connection drops, there's no way 
> to reestablish that connection without restarting node A.  Remember that 
> in case of {dist_auto_connect, once} net_kernel checks if a connection 
> is barred and if it is it won't allow to connect to a node that 
> previously was connected.

Correction 1: It's net_kernel:connect_node(Node). My bad.

Correction 2: net_kernel:connect_node/1 ignores the value of
               dist_auto_connect

What we've done is to keep a "maintenance channel" (not distr Erlang),
over which we can negotiate which node should restart.

BR,
Ulf W



More information about the erlang-questions mailing list