mnesia question: full database replication across the several nodes

Eugen Sobchenko esobchenko@REDACTED
Sat Aug 29 13:43:11 CEST 2009


Here is what I got:

start_replica(Master_node) when is_atom(Master_node) ->
	ok = mnesia:start(),

	case mnesia:change_config(extra_db_nodes, [Master_node]) of
		{ok, _} -> ok;
		{error, E} -> erlang:error({change_config_failed, E})
	end,

	mnesia:change_table_copy_type(schema, node(), disc_copies),

	Tables = mnesia:system_info(tables),
	Table_types = [ {T, mnesia:table_info(T, where_to_commit)} || T <-
Tables ],

	[ {T, mnesia:add_table_copy(T, node(), Type) } || {T, [_, Type]} <-
Table_types ].


Does this look reasonable or have I done something wrong?

Thanks in advance.


More information about the erlang-questions mailing list