moving processes from node to node

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

moving processes from node to node

Bengt Kleberg-3

> X-Injected-Via-Gmane: http://gmane.org/
> To: erlang-questions
> From: Roussel J?r?me <roussel>
> Subject: moving processes from node to node


> - is it possible to transfer a whole application (with all its modules)
> from one computer (using one erlang node) to another computer (with
> another erlang node)? I don't talk about process migration because I
> only want to copy all the files of an application from the hard drive of
> computer A to put all theses files onto the hard drive of computer B
>
> - is it possible next to check if all the needed modules are available
> on the computer B?
>
> - if all this is possible, is it possible, in one word, to move one
> application from one node to another (without doing it by hand) ???

''by hand''? does this mean ''sneaker net'' (manually carrying the
files on some media), or would ''scp <files> <computer>'' also be ''by
hand''?


while waiting for the high tech solution (presumably there is already
some otp module that does this) i have the following (bfmi) suggestion:

1 use the code module to find the modules (code:which/1)
2 use the file module to read them (file:read_file/1)
3 (possibly use rpc:call/4 with file:make_dir/1 to create correct
directory on the other node)
4 using the binaries from step 2, write them on the other node
(rpc:call/4 with file:write_file/2)


bengt



Reply | Threaded
Open this post in threaded view
|

moving processes from node to node

Roussel Jérôme
Bengt Kleberg wrote:

>>X-Injected-Via-Gmane: http://gmane.org/
>>To: erlang-questions
>>From: Roussel J?r?me <roussel>
>>Subject: moving processes from node to node
>
>
>
>> - is it possible to transfer a whole application (with all its modules)
>>from one computer (using one erlang node) to another computer (with
>>another erlang node)? I don't talk about process migration because I
>>only want to copy all the files of an application from the hard drive of
>>computer A to put all theses files onto the hard drive of computer B
>>
>> - is it possible next to check if all the needed modules are available
>>on the computer B?
>>
>> - if all this is possible, is it possible, in one word, to move one
>>application from one node to another (without doing it by hand) ???
>
>
> ''by hand''? does this mean ''sneaker net'' (manually carrying the
> files on some media), or would ''scp <files> <computer>'' also be ''by
> hand''?
>

By hand, this mean using scp (or rsync, or ...) and ''sneaker net''.
I am looking for a way to do all this with only one command in erlang
and every thing would be copied. For example, I would have a registry or
a database of every application on a node. Another node connects to the
first node, it sees the applications in tha database and says : I don't
have this application and this one, so I download them. Now, if you (the
user) want, these applications are on the computer and you can use it.

>
> while waiting for the high tech solution (presumably there is already
> some otp module that does this) i have the following (bfmi) suggestion:
>
Do you think there is an otp module for this ??? It would be wonderful.


> 1 use the code module to find the modules (code:which/1)
> 2 use the file module to read them (file:read_file/1)
> 3 (possibly use rpc:call/4 with file:make_dir/1 to create correct
> directory on the other node)
> 4 using the binaries from step 2, write them on the other node
> (rpc:call/4 with file:write_file/2)
>
>
> bengt
>
>

Thanks for this solution. It seems great,

J?r?me