Automatic node discovery

Ulf Wiger (AL/EAB) ulf.wiger@REDACTED
Mon May 2 16:16:59 CEST 2005


On May 2, Joel Reymont wrote:
>
> > Ulf Wiger (AL/EAB) wrote:
> >One way to achieve this, if you're going to use mnesia
> >anyway, is to have all nodes use this in their sys.config:
> >
> >[{mnesia, [{extra_db_nodes, MasterMnesiaNodes}]}].
> 
> Is there a way to modify this configuration dynamically or 
> even not use
> the sys.config file at all?

erl -mnesia extra_db_nodes \[foo@REDACTED,bar@REDACTED\]

The backslashes are needed for the Unix shell. Furthermore,
you cannot put any spaces after commas, and such -- the usual
stuff.

You can also set this from within Erlang, but not in any
way that isn't frowned upon, I think. Look e.g. at 
application:set_env/3, and observe well the warning. (:

You'd need to first load mnesia, then set the env variable,
then start mnesia, but if you want to use a boot script 
that starts it all, you'd have to tweak it in order to 
get it working (e.g. by inserting an {apply,application,
set_env,...} in the boot script before start of mnesia.)
Not a good idea.

/Uffe




More information about the erlang-questions mailing list