<div dir="ltr">Once upon a time, change_config didn't exist and you added new nodes with add_table_copy, I do think that is still works.<div><br></div><div>The call to the mnesia:add_table_copy(schema, slaveNode, ram_copies), must be done</div><div>on the server before change_config is done.</div><div><div><br></div><div>/Dan</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Feb 8, 2016 at 9:59 AM Vimal Kumar <<a href="mailto:vimal7370@gmail.com" target="_blank">vimal7370@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Dan,<br><div class="gmail_extra"><br><div class="gmail_quote"></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Feb 8, 2016 at 2:11 PM, Dan Gudmundsson <span dir="ltr"><<a href="mailto:dgud@erlang.org" target="_blank">dgud@erlang.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">When you start mnesia without calling create_schema, mnesia will create an empty ram_copies schema for you.<div><br></div><div>change_config(extra_db_nodes, ..) will connect and merge schema with the server.</div><div><br></div><div>What you probably want is to call mnesia:change_table_copy_type(schema, disc_copies, node)) after change_config.</div><span><font color="#888888"><div><br></div></font></span></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>True, and that is what I normally do. However, the documentation says:</div><div><br></div><div>"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."</div><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Is this statement correct, or a bug in documentation? Has anyone tried to add replica of schema table using mnesia:add_table_copy/3 and succeeded?</div><div><br></div><div>Regards,</div><div>Vimal</div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><span><font color="#888888"><div></div><div>/Dan</div><div><br></div></font></span><div class="gmail_quote"><div><div><div dir="ltr">On Sun, Feb 7, 2016 at 7:52 PM Vimal Kumar <<a href="mailto:vimal7370@gmail.com" target="_blank">vimal7370@gmail.com</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div><div dir="ltr"><div>Hello list,</div><div><br></div><div>Ref (Section 6.6): <a href="http://erlang.org/doc/apps/mnesia/Mnesia_chap5.html" target="_blank">http://erlang.org/doc/apps/mnesia/Mnesia_chap5.html</a></div><div><br></div><div>-QUOTE-</div><div>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:</div><div><br></div><div>It allows other tables to be replicated to this node.</div><div>It causes Mnesia to try to contact the node at startup of disc-full nodes.</div><div>-END QUOTE-</div><div><br></div><div>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.</div><div><br></div><div>------</div><div>$ erl -mnesia -sname slave</div><div>Erlang/OTP 18 [erts-7.0] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]</div><div><br></div><div>Eshell V7.0 (abort with ^G)</div><div>(slave@Vimals-MacBook-Pro)1> mnesia:start().</div><div>ok</div><div><br></div><div>(slave@Vimals-MacBook-Pro)3> mnesia:change_config(extra_db_nodes, ['server@Vimals-MacBook-Pro']).</div><div>{ok,['server@Vimals-MacBook-Pro']}</div><div><br></div><div>(slave@Vimals-MacBook-Pro)5> mnesia:add_table_copy(schema, node(), disc_copies).</div><div>{aborted,{already_exists,schema,'slave@Vimals-MacBook-Pro'}}</div><div>------</div><div><br></div><div>Regards,</div><div>Vimal</div></div></div></div><span>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</span></blockquote></div></div>
</blockquote></div></div></div></blockquote></div></div></div>