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

Dániel Szoboszlay <>
Thu Oct 13 17:03:41 CEST 2016


Hi,

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.

Cheers,
Daniel

On Thu, 13 Oct 2016 at 12:55 ARUN P <> 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 10.1.1.1 and the erlang node name will be
>  and the IP address of SCC connected on Rack -2 will be
> 10.1.1.2 the erlang node name will be  .
>
> 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 10.1.1.2 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
> 
> 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.html>


More information about the erlang-questions mailing list