[erlang-patches] Running mnesia across a firewall

Serge Aleynikov saleyn@REDACTED
Thu Mar 6 13:44:02 CET 2008


Ulf Wiger (TN/EAB) wrote:
> Serge Aleynikov skrev:
>> 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.

It turned out that was making the same mistake by using 
net_kernel:connect(Node) rather than net_kernel:connect_node(Node). 
Quite easy to get confused as two functions have the same signature. :-(

Thanks for pointing this out!

So for making mnesia work across a firewall a combination of kernel 
options including global_groups as well as user-level 
pinging/starting/stopping remote mnesia is sufficient.

Serge



More information about the erlang-patches mailing list