Quick tips to create mnesia tables on multiple Erlang nodes

Start node a:

erl -sname node_a@localhost

Start node b:

erl -sname node_b@localhost

Connect them, on node a:

net_adm:ping(node_a@localhost).

Then create database(schema), on node a:

Nodes = [node() | nodes()],
mnesia:create_schema(Nodes).

Then start mnesia on both nodes:

mnesia:start().

Finally create table on node a:

mnesia:create_table(mytable1,  [ {disc_copies, Nodes} ]).