开发者

How can I install Riak on several remote nodes using hot code loading?

I have been learning Riak on a single machine and have access to a cluster of Erlang nodes (on Ubuntu 9). Using re开发者_JS百科mote code loading how do I install Riak onto all the remote nodes?

For example, imagine I have a cluster of Erlang nodes. One of the nodes has Riak installed. Can I do something like nl(riak) to install Riak onto the other nodes.


Since we've added Innostore and embedded a Javascript engine Riak is no longer a pure Erlang application. This means installing via Erlang's remote code loading won't work. If you're running Riak on a homogenous cluster you should be able to build one OTP release via 'make rel', copy the release to each machine in the cluster, and tweak app.config and vm.args to suit.

A boot server would theoretically work but I don't know of anyone running Riak that way. If you decide to give it a try we (Basho) would be happy to provide assistance via the riak-users mailing list.


The short answer is: you can't.
Remote code loading operates on the module (as opposed to application) level. Riak is comprised of several Erlang modules and requires some dependencies. nl(riak) essentially loads a single module on all attached nodes.

The long answer is: you can, but don't do it.
Actually, you could gather the list of modules associated with Riak, then remote-load these and configure Riak over the wire. The application module might help with that. The problem with this approach is that if the remote node fails or reboots, you will need to transfer all of the modules again and repeat the configuration.

If some kind of "remote loading" must be involved, you should install Riak somewhere in $ERL_LIBS on the remote machine, so the load process can be initiated through rpc:call/4.


Afaik, for that there is the erl_boot_server module. I have never used (or tried) it, but it looks that is what you are looking for: http://erldocs.com/R13B03/kernel/erl_boot_server.html?search=erl&i=0

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜