[erlang-questions] mnesia schema and table copy to other nodes

Praveen Ray praveen.ray@REDACTED
Wed Jun 24 23:42:19 CEST 2009


Chandru
Thanks much.
Is there a way to search the mailing list archive? A giant list of messages
per month is not of much use.
thanks

On Wed, Jun 24, 2009 at 5:29 PM, Chandru <
chandrashekhar.mullaparthi@REDACTED> wrote:

> Hi,
>
> This has been discussed before a few times on the mailing list. See
> http://erlang.org/pipermail/erlang-questions/2007-September/029530.htmlfor example.
>
> cheers
> Chandru
>
> 2009/6/24 Praveen Ray <praveen.ray@REDACTED>
>
>> Hi
>> 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}).
>>   4.
>>
>> mnesia:create_table(person,[{attributes,record_info(fields,person)},{disc_copies,[node()]}]).
>>   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:
>> net_adm:ping('foo@*hostname*').
>> *pong*
>> 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).
>> *{atomic,ok}*
>> mnesia:add_table_copy(person, 'bar@*hostname*', disc_copies).
>> *{atomic,ok}*
>> *# back on node bar*
>> mnesia:info().
>> *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()]).
>> Thanks
>> --
>> Yellowfish Technologies Inc
>> http://www.yellowfish.biz
>> praveen.ray@REDACTED
>> (888) 817 2969 x 233
>> gtalk/skype: praveenray
>>
>
>


-- 
Yellowfish Technologies Inc
http://www.yellowfish.biz
praveen.ray@REDACTED
(888) 817 2969 x 233
gtalk/skype: praveenray


More information about the erlang-questions mailing list