Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Start your new node (<code>b@node</code>) <code>erl -sname b -mnesia dir '"/path/to/storage"' -s mnesia</code>. This starts a new ram_copies node called <code>b@node</code>.</p> <p>On your original node (<code>a@node</code>), at the erlang prompt execute <code>mnesia:change_config(extra_db_nodes, ['b@node']).</code> This will cause the original node to connect <code>b</code> to the mnesia cluster. At this point, <code>b@node</code> has joined the cluster but only has a copy of the schema.</p> <p>To make new the node <code>b@node</code> capable of storing disc copies, we need to change the schema table type on <code>b@node</code> from <code>ram_copies</code> to <code>disc_copies</code>. Run <code>mnesia:change_table_copy_type(schema, 'b@node', disc_copies).</code> on any node.</p> <p><code>b@node</code> only has a copy of the schema at this point. To copy all the tables from <code>a@node</code> to <code>b@node</code> and maintain table types, you can run:</p> <pre><code>[{Tb, mnesia:add_table_copy(Tb, node(), Type)} || {Tb, [{'a@node', Type}]} &lt;- [{T, mnesia:table_info(T, where_to_commit)} || T &lt;- mnesia:system_info(tables)]]. </code></pre> <p>This command may take a while to execute as it will copy the contents of each table over the network.</p> <p><code>b@node</code> is now an exact replica of <code>a@node</code>. You could modify that statement - replace the <code>Type</code> variable with <code>disc_only_copies</code> in the call to <code>mnesia:add_table_copy/3</code> in order to copy the tables but ensure they're on disc only.</p> <p>The <a href="http://www.erlang.org/doc/man/mnesia.html" rel="noreferrer">mnesia documentation</a> explains how to use the functions I've shown here.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload