[erlang-questions] Running an erl program on a remote machine
Mon May 23 17:01:35 CEST 2011
On 23/05/2011 16:52, wrote:
> I have been asked to write a script which runs database commands on one of n
> mirror machines. The name of the machine the commands should be run on is
> contained in a DNS alias called, say, THE_CURRENT_MACHINE. In other words,
> if the THE_CURRENT_MACHINE alias resolves to machineA.company.com,
> then the script should be run on that machine, if it resolves to
> machineB.company.com, it should run on machine b, etc.
> - write an Erlang script which will run as a daemon on machines A, B, C...
> which checks every second if the time matches the time at which the database
> commands should be triggered, and, if that is the case, run them.
You can start an Erlang node on each machine, and run on it a simple
process that waits for a start_your_db_ops.
Then on one machine you could run the master process, that resolves the
host and send the message to the appropriate node.
More information about the erlang-questions