How do I install Riak on OS X?

Go back to Table of Contents

To install Riak on OS X I will assume you are installing on Snow Leapard. First you will need to install Erlang, at least version 5.7.4 or above, which is what Riak needs as a minimum to work. To install Erlang you will need something called "ports" which allows you to install third party software onto a Mac. You can get ports from this site:

http://www.macports.org/


: Follow the instructions and once you have installed ports then it will most likely be installed in the following directory:

/opt/local/bin

: So then open a Terminal (go to Finder -> Main Mac drive -> Applications -> Terminal) also known as the command prompt and execute the command:

port

: to see if it works. If it doesn't then you need to tell your Mac where it can find programs to run:

PATH=/opt/local/bin:$PATH

: Hint: This sets what is known as an environment variable on the Mac. To see a list of all the enviroment variables type "set" at the command prompt

port install erlang

Once this has completed then type:

erl

: This should start off the erl interactive command line and should look something like this:

# erl

Erlang R13B03 (erts-5.7.4) [source] [smp:2:2] [rq:2] [async-threads:0] [kernel-poll:false]

Eshell V5.7.4 (abort with ^G)

: Note the version number. It should be at least 5.7.4.

Next you need to install "wget". wget is a utility used to retrieve software packages from the internet. So first you must install wget with:

port install wget

: and then download Riak itself. We use "cd /" here so that we store

everything in the root Mac directory but you can store it where ever

you like.

cd /

wget http://hg.basho.com/riak/get/riak-0.7.1.tar.gz

Then we unpack the compress Riak file with:

tar xzf riak-0.7.1.tar.gz

: this should create a directory called Riak. Type ls or go to finder and you should see the Riak directory under the root directory. Then you have to build Riak from the source code:

cd riak
make all rel
export RIAK=`pwd`

: And finally to test the installation:

cd rel/riak
bin/riak start
bin/riak-admin test

should produce something like:

=INFO REPORT==== 5-Feb-2010::08:33:12 ===
Successfully completed 1 read/write cycle to 'riak@127.0.0.1'

This tests that it can connect to Riak .

Thats it for installing Riak on the Mac. Most of the other things in Riak are not Mac specific so you should be able to follow them just fine.

No comments:

Post a Comment