[erlang-questions] Removing mnesia cluster node while mnesia is offline

Rudolph van Graan <>
Tue Jul 3 13:31:11 CEST 2012


Hi Francesco,


> Well, that will surely work, but it's not an attractive option, since
> it will lead to loss of data (the local tables) on that node. I was
> looking for a way to retain the local data on the offline node.

You have to set things up so that you have other replicas of those tables on other nodes. 

> The problem is that the offline node still thinks it is clustered with
> the offline (or worse, not clustered anymore nodes). Starting mnesia
> on that node will either "pollute" the other nodes by propagating the
> schema with the not-in-the-cluster-anymore nodes, or worse hangs if the
> nodes that the node thinks are still clustered are online.

This is not how mnesia works. The list of nodes in the distributed database is static, i.e. all the nodes have the same list. This is why all of them needs to be online when you add or remove nodes. The only problem that you need to solve is dealing with partitioning (i.e. splits) and you have two sets of data on two different segments. It is not possible for a node to "pollute" other nodes.  

So "... offline node still thinks it is clustered..." - it doesn't just think so, it has been configured so when you added it into the cluster. It will stay part of the cluster until you remove it. 

On 3 Jul 2012, at 12:18, Francesco Mazzoli wrote:

> Hi Rudolph, thanks for the answer.
> 
> At Tue, 03 Jul 2012 12:01:34 +0100,
> Rudolph van Graan wrote:
>> I would suggest that you think differently about the
>> problem. Instead of trying to 'remove' the node from the schema
>> (which requires you to modify it and all the nodes must be online),
>> think that the offline node that is destroyed. So in this case,
>> delete the mnesia data on the failed node (all the files in the
>> mnesia data directory) and bring it back online. Or alternative,
>> start a clean instance with the same node name as the failed node.
> 
> Well, that will surely work, but it's not an attractive option, since
> it will lead to loss of data (the local tables) on that node. I was
> looking for a way to retain the local data on the offline node.
> 
> --
> Francesco * Often in error, never in doubt
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list