mnesia schema and table copy to other nodes

Praveen Ray <>
Wed Jun 24 22:49:31 CEST 2009

I've recently started learning erlang/mnesia and need help setting up mnesia
on two nodes. Here's the series of steps (on same host):
$cd ~/test/foo
$erl -sname foo -setcookie chip_cookie

   1. mnesia:create_schema([node()]).
   2. mnesia:start().
   3. rd(person, {name,age}).
   5. mnesia:dirty_write(#person{name="george", age=30}).

# in another window, on same host:
$cd ~/test/bar
$erl -sname bar -setcookie chip_cookie
1> mnesia:start().
#back on foo node:
mnesia:add_table_copy(schema, 'bar@*hostname*', disc_copies).
*{aborted,{badarg,schema,disc_copies}} <--- WHY DOES THIS FAIL?*
mnesia:add_table_copy(schema, 'bar@*hostname*', ram_copies).
mnesia:add_table_copy(person, 'bar@*hostname*', disc_copies).
*# back on node bar*
*It doesn't show the 'person' table that was copied from foo. Why is that?*
How can I add more nodes to an existing mnesia database which was created
with only one node ie. mnesia:create_schema([node()]).
Yellowfish Technologies Inc

(888) 817 2969 x 233
gtalk/skype: praveenray

More information about the erlang-questions mailing list