Oct

Installing RabbitMQ on OSX
RabbitMQ is a reliable, high performance queue Server written in Erlang.
Lets fiddle.
Before you start
Before you can start, you have to have installed Macports. Just in case, here’s how it’s done:
- Register at the Apple Developers Connection. Go to downloads/developer tools, and download the latest version of the XCode Developer tools. Grab a Flask of coffee.
- Download and run the latest macports installer http://svn.macports.org/repository/macports/downloads/. Grab another Flask.
Installing Erlang
If you’re on the 10.5.3 update, you have to edit the erlang portsfile to avoid a bus error bug:
sudo vi /opt/local/var/macports/sources/rsync.macports.org/release/ports/lang/erlang/Portfile
Delete this line from configure.args attribute:
--enable-hipe \
Now you can use port to install erlang:
port install erlang
this is going to take a while.
Installing RabbitMQ
Grab and unpack the lastest generic Unix version of RabbitMQ. The current version as of writing is 1.4.0.
mkdir /tmp/rabbit-mq && cd /tmp/rabbit-mq
wget http://www.rabbitmq.com/releases/rabbitmq-server/v1.4.0/rabbitmq-server-generic-unix-1.4.0.tar.gz
tar xvfz rabbitmq-server-generic-unix-1.4.0.tar.gz
Now move this stuff into erlang’s magical mystery directory:
sudo mv rabbitmq_server-1.4.0 /opt/local/lib/erlang/lib
You’re good to go! Start up like this:
sudo /opt/local/lib/erlang/lib/rabbitmq_server-1.4.0/sbin/rabbitmq-server
Change permissions if you don’t want to run this as root.
UPDATE: I’ve been having troubes starting the server up, since the tables in the mnesia database backing rabbitmq are locked. I don’t know why this is the case. You can get this running again brute force styleee by deleting the database:
sudo rm -rf /var/lib/rabbitmq/mnesia



Comments
There are 7 Comments for this post. Write comment →
Thanks guys!
Hi, I have tried installing rabbitmq through different methods.
Every time the server works, listens to port (telnet on it works) but rabbitmqctl can’t connect.
Thanks.
Hi Rany,
Great writeup!
I followed this up with an article of my own, which is more geared at getting a dev version of Rabbit running on OSX:
http://hopper.squarespace.com/blog/2008/11/15/how-i-install-rabbitmq-on-osx.html
Anybody reading this should probably follow Rany’s method rather than mine, because his will be easier.
Ben
Hum, I guess something is wrong with my setup, I get the following error:
starting recovery …{“init terminating in do_boot”,{{nocatch,{error,{cannot_start_application,rabbit,{{bad_type,realm_exchange,{realm_resource,’_’,>}},{rabbit,start,[normal,[]]}}}}},[{init,start_it,1},{init,start_em,1}]}}
Any tiphere?
It looks like the current release of rabbitMQ (1.4.0) does not work with the current release of Erlang R12B-5. R12B-5 is what you get if you install Erlang with the current release of DarwinPorts.
So you ether need to use the previous version of Erlang, or follow the instructions by Ben Hood that were pointed to in the earlier reply (http://hopper.squarespace.com/blog/2008/11/15/how-i-install-rabbitmq-on-osx.html)
Ben’s instructions have you use the default RabbitMQ mercurial repository instead of the official 1.4.0 source tar ball. This worked fine for me.
I would be interested in what’s the best way to install it for automatic startup and stuff so it just works as a service on the Macintosh.
There’s also:
sudo port install rabbitmq-server
Thank you for this article. On the other hand RabbitMQ is available on macports for quite some time. It’s much easier way of installing, upgrading and maintaining and thus I would recommend this method of obtaining RabbitMQ on OS X. There are some quirks, though. For example at the moment rabbitmq-server package requires py25-simplejson, which is very annoying for me (I have python2.4 and python2.6 installed and don’t want another version of python). However, most of these might be easily solved by editing portfile (in this case it was /opt/local/var/macports/sources/rsync.macports.org/release/ports/net/rabbitmq-server/Portfile).
Write a comment
Required in bold.