6

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 riak1@127.0.0.1, riak2@127.0.0.1, 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?

otto.poellath
  • 4,129
  • 6
  • 45
  • 60

1 Answers1

8

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.

Brian Roach
  • 76,169
  • 12
  • 136
  • 161
  • 4
    Thanks, Brian. I wrote a little script to set up the nodes from a homebrew riak installation: http://ottopoellath.github.com/blog/2012/04/08/running-a-three-node-riak-cluster-using-a-homebrew-installation/ – otto.poellath Apr 08 '12 at 17:02
  • In newer version of riak `RUNNER_SCRIPT_DIR` is now set in `libexec/lib/env.sh` – Paul Valla Apr 27 '14 at 09:20