<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>Not sure if you've seen the (admittedly short) tutorials on TrapExit:</div><div><br></div><div><a href="http://www.trapexit.org/Distributing_a_Mnesia_schema">http://www.trapexit.org/Distributing_a_Mnesia_schema</a></div><div><br></div><div>A minor comment: you can do this instead:</div><div><br></div><div>mnesia:start([{extra_db_nodes, Nodes}])</div><div><br></div><div>If you want the nodes to start from a boot script, you can either roll your own the old-fashioned way:</div><div><br></div><div><a href="http://www.trapexit.org/OTP_Release_Handling_Tutorial">http://www.trapexit.org/OTP_Release_Handling_Tutorial</a></div><div><br></div><div>or use rebar and Reltool:</div><div><br></div><div><a href="http://www.metabrew.com/article/erlang-rebar-tutorial-generating-releases-upgrades">http://www.metabrew.com/article/erlang-rebar-tutorial-generating-releases-upgrades</a></div><div><br></div><div>In this case, it's better to put the extra_db_nodes setting in the sys.config file:</div><div><br></div><div>[…,</div><div> {mnesia, [ </div><div>                   {extra_db_nodes, [node@host1, node@host2]}</div><div>                  ]}</div><div><br></div><div>Then, calling mnesia:start() will suffice, given that you've started the node in the right way.</div><div><br></div><div>BR,</div><div>Ulf W</div><br><div><div>On 19 Mar 2012, at 17:59, Wojciech Knapik wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; "><div style="word-wrap: break-word; "><div>I much prefer to have a slightly more strict setup, where you e.g. designate one or two "master" machines that keep a persistent copy of the database. The other machines can start up with the env variable: extra_db_nodes : MasterNodes, and access the database without even having their own copy.</div><div><br></div><div>Why does the data need to be fully replicated? Nodes starting with extra_db_nodes as above enjoy full distribution transparency. If very rapid read response is required, you can add a ram-based replica on the fly with the function mnesia:add_table_copy_type(Table, Node, CopyType). </div><div><br></div><div>Update cost will increase noticeably with every replica you add, so in many cases, it may be counter-productive to use full replication. For fault tolerance, having two persistent copies of the data goes a long way.</div><div><br></div><div>Nodes can also start with extra_db_nodes, receive a ram copy of the schema, and then change their schema to a persistent copy using mnesia:change_table_copy_type(schema, node(), disc_copies).</div></div></blockquote><div><br></div><div>Ok, that's a lot to process for someone new to mnesia, so let me answer this fully, once I'm back home from work. </div><br class="Apple-interchange-newline"></blockquote></div><br></body></html>