[erlang-questions] Adding new nodes to a Msenia group?
Mon Apr 30 10:32:29 CEST 2007
On 30/04/07, Tom Samplonius <tom@REDACTED> wrote:
> ----- "Chandru" <chandrashekhar.mullaparthi@REDACTED> wrote:
> > On 27/04/07, Tom Samplonius <tom@REDACTED> wrote:
> > >
> > Once you have one node with an mnesia schema, you can add new nodes
> > to
> > the schema using the function mnesia:add_table_copy/3. Look in the
> > user guide - I'm sure you will find it in there.
> > Whenever you add a new node to the schema, you first have to create
> > the schema as a ram_copies table on the new node and then change it
> > to
> > a disk based one.
> I still can't see how to do this. I setup a single Mnesia node, with on-disk schema, and then created a single table. Then I setup a second node (but did not create an on-disk schema with create_schema/1), and attempted to duplicate the "schema" table to the second node. It seems to work:
> (a@REDACTED)14> mnesia:add_table_copy(schema, b@REDACTED, ram_copies).
> and b@REDACTED shows as a stopped node, but b@REDACTED is never updated or connected to (nodex() is empty). I can use connect_to/1 to force a node connection, but Mnesia still shows b@REDACTED as down.
erl -sname b
%% At this point, the schema will be copied over to b@REDACTED
mnesia:change_table_copy_type(schema, node(), disc_copies).
mnesia:add_table_copy(my_table, node(), disc_copies).
More information about the erlang-questions