[erlang-questions] Adding new disc_copies node to existing schema

Dmitriy Gorbenko <>
Tue Sep 25 21:13:07 CEST 2007


Hi all.

I need an advice: I have two nodes ( and ). The
are in the same schema.
And I want to add a new node  to existing schema.

Next code is helpless, because it creates ram_copies node in schema:

mnesia:change_config(extra_db_nodes, []).
mnesia:add_table_copy(tt, , ram_copies).

but I need create a disc_copies node.

If I create a backup and change node name - this is also not helping me:


()6> mnesia:backup("./backup").
ok
()7> c(a).
{ok,a}
()8> a:change_node_name(, , "./backup",
"./new_backup").

 * Checking table: 'schema'
   + Checking key: 'disc_copies'
     - Replacing nodename: '''' with: ''''
     - Node: '''' will not be modified (it is not
'''')
   + Checking key: 'disc_only_copies'

 * Checking table: 'tt'
   + Checking key: 'disc_copies'
     - Replacing nodename: '''' with: ''''
     - Node: '''' will not be modified (it is not
'''')
   + Checking key: 'disc_only_copies'
{ok,switched}
()9>


Then I copied this backup to , and trying to restore one:

()2> mnesia:start().
ok
()4> mnesia:restore("./new_backup", [{default_op,
recreate_tables}]).
{aborted,{'EXIT',{aborted,{bad_commit,{missing_lock,''}}}}}
()5> 


I think it's impossible to create another disc_copies node in existing
schema. Only ram_copies.
Or, I could be possible, if I could remove at node1 from schema node2,
then create backup, and then collect all nodes into one schema. But I
did not find how I could remove node from schema. Like:

mnesia:remove_node_from_schema().

If anyone knows how to solve the problem - please, help me.

Dmitriy.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2244 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20070925/7a87d976/attachment.bin>


More information about the erlang-questions mailing list