Search code examples
macoshomebrewriak

Setting which configuration to use for riak installed via brew


I just did brew install --devel riak to get riak 2.0.1 on my OSX machine. After that I started a node with:

/usr/local/Cellar/riak/2.0.1/bin/riak start

What I see in ps ax is that it's using some /usr/local/Cellar/riak/2.0.1/libexec/data/generated.configs/vm.2014.10.03.11.27.37.args config:

➜  ~  ps ax | grep riak
96269   ??  S      0:00.01 /usr/local/Cellar/riak/2.0.1/libexec/erts-5.10.3/bin/epmd -daemon
96277   ??  S      0:00.00 /usr/local/Cellar/riak/2.0.1/libexec/erts-5.10.3/bin/run_erl -daemon /tmp/riak// /usr/local/var/log/riak exec /usr/local/Cellar/riak/2.0.1/libexec/bin/riak console
96849 s013  R+     0:00.00 grep riak
96279 s017  Rs+    8:59.91 /usr/local/Cellar/riak/2.0.1/libexec/erts-5.10.3/bin/beam.smp -P 256000 -e 256000 -Q 65536 -A 64 -K true -W w -zdbbl 32768 -- -root /usr/local/Cellar/riak/2.0.1/libexec -progname riak -- -home /Users/kb -- -boot /usr/local/Cellar/riak/2.0.1/libexec/releases/2.0.1/riak -config /usr/local/Cellar/riak/2.0.1/libexec/data/generated.configs/app.2014.10.03.11.27.37.config -setcookie riak -name [email protected] -smp enable -vm_args /usr/local/Cellar/riak/2.0.1/libexec/data/generated.configs/vm.2014.10.03.11.27.37.args -pa /usr/local/Cellar/riak/2.0.1/libexec/lib/basho-patches -- console

As I understand, what I'd like to have is to use /usr/local/Cellar/riak/2.0.1/libexec/etc/riak.conf config, which is much more like good old /etc/riak.conf from linux.

What should I do to use it? Thanks!


Solution

  • The key word there is generated. The script that starts Riak takes the riak.conf file. It converts that from the dotted format that is nice for people to edit, to the app.config and vm.args format that erlang wants to read. It then merges it with any advanced.config file that may be there, and writes it to generated.configs, and has erlang use that. Even on linux, it doesn't use riak.conf directly, but rather a generated config based on it.

    If you want the why and how, take a look at the cuttlefish repo