Best practice for using erlang modules in riak?

Sylvain Niles sylvain.niles at gmail.com
Tue May 24 21:55:57 EDT 2011


So I've seen a few well written examples of erlang map or reduce
functions in the contrib section of the wiki/github but the missing
piece of glue for me is: Where do I compile from? I've done a lot of
ejabberd development and generally I just throw it in the src
directory, add a config param to the ejabberd.conf to load my new
module at startup, make install, and I'm done. Should I be deploying
my modules to /deps/riak_core/src/?

The wiki has this note:

Distributing Erlang MapReduce Code

Any modules and functions you use in your Erlang MapReduce calls must
be available on all nodes in the cluster. You can add them in Erlang
applications by specifying the -pz option in vm.args or by adding the
path to the add_paths setting in app.config.

But the vm.args page does not list the valid config format/options for
the -pz option. Is the add_paths behavior such that a valid beam in
that dir will automatically be loaded on startup and all exported
functions available? What about live code updates of internally
developed modules?

Thanks in advance!

-Sylvain




More information about the riak-users mailing list