[erlang-questions] Running an erl program on a remote machine

Parnell Springmeyer ixmatus@REDACTED
Mon May 23 23:41:50 CEST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Python + Fabric

Erlang could be used, but honestly, it really isn't suited for that sort
of thing - if you had to process a set of data across multiple nodes,
then I would totally recommend Erlang; but Python + Fabric is just so
/easy/ to run shell commands on remote machines!

phiroc@REDACTED writes:

> Hi,
>
> 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.
>
> I have thought of several ways of doing the above:
>
> - run a PERL script at a set time each day on a machine which I will call
> machinex, which resolves the THE_CURRENT_MACHINE alias, connects to 
> it via SSH and runs the database commands. The disadvantage of 
> this solution is that, if machinex is down, the PERL script won't be run.
>
> - run a PERL script at a set time each day on machines A and B (and C and D...) 
> makes sure that the current machine's name is equal to THE_CURRENT_MACHINE value,
> and, if that is the case, runs the database commands.
> The disadvantage of this solution is that if I have 10 machines, I 
> must duplicate the script on those ten machines.
>
> - write an Erlang program which create a remote process on THE_CURRENT_MACHINE that 
> runs the database commands, if it is feasible. Once again, if machinex is down,
> the program won't be run.
>
> - 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. 
>
> If I had never heard of Erlang and of its alleged "spawn a remote process" capabilities,
> I would opt for solution 2 above. If you fellows have a better solution, please let me know.
>
> Philippe
>
>
>
>
> ----- Mail Original -----
> De: "Carlo Bertoldi" <carlo.bertoldi@REDACTED>
> À: erlang-questions@REDACTED
> Envoyé: Lundi 23 Mai 2011 16:20:24 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
> Objet: Re: [erlang-questions] Running an erl program on a remote machine
>
> On 23/05/2011 16:12, phiroc@REDACTED wrote:
>> Hello,
>>
>> is it possible to run an erlang program on a remote machine without using the erl console?
>>
>> For instance, let's say that I have written a program that runs a batch script and that I would like to run it on machine B at a set time. Can I create an entry in my machine's crontab which runs the following script:
>>
>> erl -name machineB -detached<the name of the erl script that runs the batch script>
>>
> Why would you want to do that?
> Why not put that command directly in B's crontab?
>
>   Carlo
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

- -- 
Parnell "ixmatus" Springmeyer (http://ixmat.us)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org

iQEcBAEBAgAGBQJN2tSfAAoJEPvtlbpI1POLeLQH/RDeKBsjW1HyhExU4qTDSpGV
ebBesrAaJ0NCl+VFIx0n/p9m8C0KnWL5RsZjH74PQJruaG3BA9bT9LGlCIc+3EEF
QfM42OmArCujvlnbCSmE+ntRCJIWTTSSGBEJE4sMtDbeGiGjOib+4AT5Q8IkHFIT
+UYL+AZwqMJwu3MmNc3OIpq26amCzM0UAZ/05AXSPusIUU8oVnh48tyawyfsTq6F
J2z5TlcHbsNqi0aloGq2vXqshUvtZ3wnAyw33ze88UTNDE5eC0dLrf1ING2mZLt1
is6YyHENxhdtrD6pKXipeBLzMu8TJQf0rI8+keFMvVFngeF85JRZuSuGI42D/84=
=VaNN
-----END PGP SIGNATURE-----



More information about the erlang-questions mailing list