distributed system: same app, different params

Roberto Ostinelli roberto@REDACTED
Wed Jun 17 16:02:03 CEST 2009


dear all,

what is the best way to configure a distributed system to startup  
several erlang nodes, each running the same OTP application but with  
different parameters?

let's say that i want to start 2 local erlang nodes, each running  
my_app, however with different parameters.

what i do now is:

1. i have an escript file which:
     - reads the parameters from a configuration file
     - starts the 2 erlang nodes, using os:cmd/1 and passing the  
configuration parameters, with a command like

run_erl -daemon  $PIPE_DIR/$node_id $LOGS_DIR "exec erl -name $node_id  
-run go start -params $params"

2. in the module go, the function start/1:
     - reads the passed parameters;
     - starts the application my_app, passing the appropriate values.

3. the escript file is started as daemon on the target machine.


though this does work, it seems way too non-erlangish to me.

i have read about releases and boot scripts. however, i'm a little  
lost in how to package everything so that i could perform the same  
thing that i accomplish now with the boot script. i've searched the  
forums but have been unable to find a response to this query.

pardon me for asking what may seem an obvious question to many of you:  
i'd sure love to hear a pointer as to where i could start to do in the  
best way according to OTP principles.

thank you in advance,

r.


More information about the erlang-questions mailing list