[erlang-questions] Remove running node from mnesia cluster

Kristoffer Brown erlangerintraining@REDACTED
Sun Jul 20 00:26:07 CEST 2014


Hello all,

I have a requirement to remove a running node from an mnesia cluster. This
is a legitimate node that needs to have some maintenance performed.
However, we want to keep this node running and servicing requests. I found
this post. Which helps remove it from the additional nodes. However, once
you re-start mnesia on the orphan node, it returns to the other nodes in
the cluster.

>From each of the non-orphan nodes, I run a script that does the following:

    rpc:call('node_to_be_orphaned', mnesia, stop, []),
    mnesia:del_table_copy(schema, 'node_to_be_orphaned'),

^^ At this point mnesia:system_info(db_nodes) shows that the node has
indeed been removed.

    rpc:call('node_to_be_orphaned', mnesia, start, []),

Now it's back. Ugh!

So, I then tried to flip it and remove the other nodes from the orphan
first adding the following.

    rpc:call(ThisNode, mnesia, stop, []),
    rpc:call('node_to_be_orphaned', mnesia, del_table_copy, [schema,
node()]),
    rpc:call(ThisNode, mnesia, start, []),

This just creates a loop with no difference.

Is there a way to take a node out of mnesia clustering while leaving it
up-and-running?

Any and all guidance is greatly appreciated.

Best.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140719/9966caaf/attachment.htm>


More information about the erlang-questions mailing list