To install the sample hook,
-
Compile
riak_repl_hook_sample.erl
Note on the Erlang Compiler: You must use the Erlang compiler (
erlc
) associated with the Riak installation or the version of Erlang used when compiling Riak from source. For packaged Riak installations, you can consult Table 1 below for the default location of Riak’s erlc for each supported platform. If you compiled from source, use the erlc from the Erlang version you used to compile Riak.Distribution Path CentOS & RHEL Linux /usr/lib64/riak/erts-5.9.1/bin/erlc Debian & Ubuntu Linux /usr/lib/riak/erts-5.9.1/bin/erlc FreeBSD /usr/local/lib/riak/erts-5.9.1/bin/erlc SmartOS /opt/local/lib/riak/erts-5.9.1/bin/erlc Solaris 10 /opt/riak/lib/erts-5.9.1/bin/erlc Table 1: Erlang compiler executable location for packaged Riak installations on supported platforms
Once you have determined the location of the Erlang compiler, compiling (on Ubuntu for example) is as simple as:
/usr/lib/riak/erts-5.9.1/bin/erlc riak_repl_hook_sample.erl
-
Copy the
riak_repl_hook_sample.beam
file to the subdirectory you want to store the custom hookcp riak_repl_hook_sample.beam /path/to/replication/hook
-
Add a
-pa
argument to yourvm.args
file-pa /path/to/replication/hook
-
Add a
-run
argument to yourvm.args
file-run riak_repl_hook_sample register