开发者

How do I send a module to an Erlang node?

开发者 https://www.devze.com 2022-12-19 02:24 出处:网络
I have several nodes running in an erlang cluster, each using the same magic cookie and trusted by each other. I want to have one mast开发者_如何学JAVAer node send code and modules to the other nodes.

I have several nodes running in an erlang cluster, each using the same magic cookie and trusted by each other. I want to have one mast开发者_如何学JAVAer node send code and modules to the other nodes. How can I do this?


use nl(module_name). to load code on all the nodes.


Check out my etest project for an example of programmatically injecting a set of modules on all nodes and then starting it.

The core of this is pretty much the following code:

{Mod, Bin, File} = code:get_object_code(Mod),
{_Replies, _} = rpc:multicall(Nodes, code, load_binary,
                              [Mod, File, Bin]),
0

精彩评论

暂无评论...
验证码 换一张
取 消