Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'm extremely late to the party, but came across this info in the doc when looking for a solution to the same problem:</p> <blockquote> <p>"The function call mnesia:del_table_copy(schema, mynode@host) deletes the node 'mynode@host' from the Mnesia system. The call fails if mnesia is running on 'mynode@host'. The other mnesia nodes will never try to connect to that node again. Note, if there is a disc resident schema on the node 'mynode@host', the entire mnesia directory should be deleted. This can be done with mnesia:delete_schema/1. If mnesia is started again on the the node 'mynode@host' and the directory has not been cleared, mnesia's behaviour is undefined." (http://www.erlang.org/doc/apps/mnesia/Mnesia_chap5.html#id74278)</p> </blockquote> <p>I think the following might do what you desire:</p> <pre><code>AllTables = mnesia:system_info(tables), DataTables = lists:filter(fun(Table) -&gt; Table =/= schema end, AllTables), RemoveTableCopy = fun(Table,Node) -&gt; Nodes = mnesia:table_info(Table,ram_copies) ++ mnesia:table_info(Table,disc_copies) ++ mnesia:table_info(Table,disc_only_copies), case lists:is_member(Node,Nodes) of true -&gt; mnesia:del_table_copy(Table,Node); false -&gt; ok end end, [RemoveTableCopy(Tbl,'gone@gone_host') || Tbl &lt;- DataTables]. rpc:call('gone@gone_host',mnesia,stop,[]), rpc:call('gone@gone_host',mnesia,delete_schema,[SchemaDir]), RemoveTablecopy(schema,'gone@gone_host'). </code></pre> <p>Though, I haven't tested it since my scenario is slightly different.</p>
 

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