views:

204

answers:

3

I have been learning Riak on a single machine and have access to a cluster of Erlang nodes (on Ubuntu 9). Using remote 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.

+3  A: 

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.

Felix Lange
What I intend to do is to contact the Riak staff, as remote code loading is a core feature of Erlang, and the Riak installation process is so bug ridden on each platform that remote code loading is probably a must to install Riak on many servers.
Zubair
+1  A: 

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

ZeissS
+3  A: 

Since we've added Innostore (http://hg.basho.com/innostore) and embedded a Javascript engine (http://hg.basho.com/erlang_js) 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.

Kevin Smith
Would it work if the embedded Javascript engine or Innodb functionality was disabled somehow?
Zubair
Nice to see Basho is supporting its products in the wild :)
ZeissS