[erlang-questions] Can we use same mnesia schema on different nodes

Dániel Szoboszlay dszoboszlay@REDACTED
Thu Oct 13 17:03:41 CEST 2016


When the name of the node changes, you need to repair the Mnesia schema, as
it contains the names of the nodes where the tables belong.

Before starting Mnesia open the schema.DCD or schema.DAT file (depending on
the storage type of your schema). It will be either a disk_log or a dets
file, containing {schema, Tab, Opts} entries. Among the options you will
find the node(s) where the table shall exist. Simply change the old node
name to the new node name there, and save the new schema under its original
file name. Then you can start Mnesia and all your data will be there.


On Thu, 13 Oct 2016 at 12:55 ARUN P <arunp@REDACTED> wrote:

> Hi,
>      I have a hardware device, will call it SCC ( System Control Card )
> on which an erlang application is running which uses mnesia as the
> database. The hardware device is a distributed and portable one and its
> IP address is dynamically generated based on some physical conditions.
> ie, My system set up contains 10 Racks and each Rack has SCC connected
> to it, and based on the Rack on which SCC is connected application will
> dynamically generate the IP address ie; the IP address of SCC connected
> on Rack -1 will be and the erlang node name will be
> SCC@REDACTED and the IP address of SCC connected on Rack -2 will be
> the erlang node name will be SCC@REDACTED .
> The problem domain is :
>      In some situations i will be replacing SCC of Rack-1 to Rack-2 and
> as soon as i replace , IP address of SCC will change to and so
> the erlang node. In this situation I am unable to access the data stored
> in mnesia when the SCC was present in Rack-1 and this is because the on
> Rack-2 application will create a new schema based on the new erlang node
> name. But the prime objective of my system is data persistence, even
> though I replace the device on any Rack, I should be able to access the
> previously stored data. Can anybody kindly suggest me how to solve this
> issue.
> - All the tables and schema created are disc copy .
> Thanks in advance,
> Arun P
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20161013/4a027a8e/attachment.htm>

More information about the erlang-questions mailing list