[erlang-questions] Mnesia schema replicas

Dan Gudmundsson <>
Mon Feb 8 09:41:51 CET 2016


When you start mnesia without calling create_schema, mnesia will create an
empty ram_copies schema for you.

change_config(extra_db_nodes, ..) will connect and merge schema with the
server.

What you probably want is to call mnesia:change_table_copy_type(schema,
disc_copies, node)) after change_config.

/Dan

On Sun, Feb 7, 2016 at 7:52 PM Vimal Kumar <> wrote:

> Hello list,
>
> Ref (Section 6.6): http://erlang.org/doc/apps/mnesia/Mnesia_chap5.html
>
> -QUOTE-
> The functions mnesia:add_table_copy/3 and mnesia:del_table_copy/2 can be
> used to add and delete replicas of the schema table. Adding a node to the
> list of nodes where the schema is replicated affects the following:
>
> It allows other tables to be replicated to this node.
> It causes Mnesia to try to contact the node at startup of disc-full nodes.
> -END QUOTE-
>
> I can use the functions mnesia:add_table_copy/3 and
> mnesia:del_table_copy/2 to add and delete replicated copies of other tables
> successfully, but not table 'schema'. In fact I am not sure at what point
> in initialization process of a new mnesia node should this be run. Please
> assist.
>
> ------
> $ erl -mnesia -sname slave
> Erlang/OTP 18 [erts-7.0] [source] [64-bit] [smp:4:4] [async-threads:10]
> [hipe] [kernel-poll:false]
>
> Eshell V7.0  (abort with ^G)
> ()1> mnesia:start().
> ok
>
> ()3> mnesia:change_config(extra_db_nodes,
> ['']).
> {ok,['']}
>
> ()5> mnesia:add_table_copy(schema, node(),
> disc_copies).
> {aborted,{already_exists,schema,''}}
> ------
>
> Regards,
> Vimal
> _______________________________________________
> 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/20160208/50d60f0c/attachment.html>


More information about the erlang-questions mailing list