[erlang-questions] Re-using Mnesia disk files for a different node

Yash Ganthe <>
Mon Sep 23 08:58:34 CEST 2013


Hi,

On a node named  I created an Mnesia schema using:
mnesia:create_schema([node()]).
and created a table using:
mnesia:create_table(tab1, [{disc_copies, [node()]}, {attributes, record_info(fields, tab1)}]).

The mnesia directory was set to "mnesia_node1". The directory was created and the DB files were created inside it.

Once the node was stopped, the DB files still exist in the directory. I hoped to re-use the DB as the mnesia DB for another node, node2.

So I started the other node using:
erl -name node2 -mnesia dir "mnesia_node1".

On node2 when I start mnesia and do a tv:start(), I see the tab1 listed in the schema. However, it shows no records. I was expecting Mnesia to use the directory as the location of all DB files.

Is there something I have missed?

Thanks,
Yash

DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20130923/67d41647/attachment.html>


More information about the erlang-questions mailing list