Press "Enter" to skip to content

Building RabbitMQ on Mac OSX Leopard

At Cinch, we are looking into a high volume, high performance message queuing mechanism for aggregating updates from javascript logging into our data stores. The first one we are investigating is RabbitMQ which seems to have a good rep.

Though we are deploying on Linux, we do all our development on Mac OS X. It turned out that it was a bit more tweaky to get RabbitMQ to install on Mac OS X if we wanted to use the latest version of RabbitMQ and its underlying Erlang Environment.

So this is what we’ve done so far to get it installed.

Instructions Source

The core of this information came from the blog entry of Ben Hood, RabbitMQ contributor How I Install RabbitMQ On OSX

I’ve added a few things that were important in our environment.

Make sure MacPorts bin is before default bin

Your Unix PATH must have the MacPorts bin (/opt/local/bin before /usr/bin or /bin)

Ideally change it in the Mac OS X environment and not just your shell. You can use the RCEnvironment (Environment Variables) System Preference to set/update the PATH Environment variable. Or you can edit ~/.MacOSX/environment.plist file. Make sure that you don’t override this in your .bachrc or .tcshrc shell startup files. Or that you do it properly there as well.

This is mainly needed to make sure that you are using the python and python libraries from MacPorts and not the default Apple Leopard python in /usr/bin. It is also needed for the path to the Erlang binaries.

Install Erlang

* Use MacPorts via command line or Portecus to install Erlang. We did use R12B-5 with hipe, ssl, and smp options.
* Link erl_call into /opt/local/bin

UnixPrompt> sudo ln -s /opt/local/lib/erlang/lib/erl_interface-3.5.9/bin/erl_call /opt/local/bin

Install Mercurial

This is needed to install RabbitMQ from the default branch (this is a stable branch but may be beyond the current release). RabbitMQ 1.4.0 will not work with Erlang/OTP R12B-5. Please use R12B-4 or earlier by default.

Get a Mac Binary package.

Install python simple json

Using MacPorts, you can use the following commands:

UnixPrompt> sudo port install py25-simplejson
UnixPrompt> sudo port install python_select
UnixPrompt> sudo python_select python25

Make sure that you have the right python in your path:

UnixPrompt> which python
/opt/local/bin/python

Get RabbitMQ via mercurial

UnixPrompt> hg clone http://hg.rabbitmq.com/rabbitmq-codegen
UnixPrompt> hg clone http://hg.rabbitmq.com/rabbitmq-server

Build and run the rabbitMQ

UnixPrompt> cd rabbitmq-server
UnixPrompt> make -j run

Should then see something like:

NODE_IP_ADDRESS= NODE_PORT= NODE_ONLY=true LOG_BASE=/tmp  RABBIT_ARGS=" -s rabbit" MNESIA_DIR=/tmp/rabbitmq-rabbit-mnesia ./scripts/rabbitmq-server
   Erlang (BEAM) emulator version 5.6.4  [smp:2] [async-threads:30] [kernel-poll:true]

   Eshell V5.6.4  (abort with ^G)
   (rabbit@xlr8)1> RabbitMQ %%VERSION%% (AMQP 8-0)
   ...
   Logging to "/tmp/rabbit.log"
   SASL logging to "/tmp/rabbit-sasl.log"

   starting database             ...done
   starting core processes       ...done
   starting recovery             ...done
   starting persister            ...done
   starting builtin applications ...done
   starting TCP listeners        ...done

   broker running

You are now up and running!

TBD: Figure out how to integrate it into Mac OS X so its treated as a system service started at bootup.