Search code examples
macoshomebrewriak

Running a three node riak cluster using a homebrew installation


I installed Riak on my Mac via homebrew, and would like to set up a local three node cluster.

The basho fast track tutorial is however based on a source build, and as far as I know, those instructions won't apply to my homebrew install (e.g. make devrel will generate 3 nodes, but my install doesn't contain the makefile).

I tried making 3 copies of /usr/local/Cellar/riak, named dev1, dev2 and dev3. Then I adjusted the http, handoff_port and pb_port settings in devN/1.1.1x86_64/libexec/etc/app.config as well as the -name setting in devN/1.1.1x86_64/libexec/etc/vm.args (I used 81XX for the ports used by node dev1, 82XX for those used by node dev2, etc. For the -namesetting I used [email protected], [email protected], etc).

Node dev1 can successfully be started using ./dev1/1.1.1x86_64/bin/riak start. But upon starting node dev2 using ./dev2/1.1.1x86_64/bin/riak start, riak complains that the node is already running.

How do I get riak to recognize the three installations as separate nodes?


Solution

  • The problem is the RUNNER_SCRIPT_DIR variable in the ./devN/1.1.1x86_64/bin/riak scripts - It's set to /usr/local/Cellar/riak/1.1.1x86_64/libexec/bin in the original homebrew version you copied.

    This is used later in the script in the ping_node function (and actually, everything else). The -name and -setcookie and all the other settings are being pulled out of the vm.args in /usr/local/Cellar/riak/1.1.1x86_64/libexec/etc directory instead of the copies you made.

    Change that in each of your copies of the riak script and you should be good to go.