OK, so a few people heard that I was playing with RabbitMQ and MCollective and hinted (less than subtly I might add!) that a blog post might be in order, so here it is.  If you want someone to blame, look no further than @patrickdebois and @garethr 🙂

The original issue was as follows:

  1. I already use MCollective with ActiveMQ over STOMP, but the XML config format is a nightmare.
  2. I want to use LogStash but that uses AMQP and ActiveMQ doesn’t support that.
  3. I don’t want to have to run two message queuing servers on my network.

@ripienaar mentioned that he’d managed to get MCollective working with RabbitMQ’s new stomp plugin, and RabbitMQ is the AMQP server suggested by the logstash site.  This looked promising – could I really kill two birds with one stone?

The answer – I’m pleased to announce – is yes, I was able to kill two birds with one stone, and this is how I did it…

Installing RabbitMQ

Install RabbitMQ-server 2.2.0 from the package downloaded from the RabbitMQ website as the version in EPEL doesn’t support the STOMP plugin.

I’ve found (as with so many of these things!) if the package is available as an RPM it’s probably easier to create your own YUM Repository on a webserver somewhere and point a yum.repo.d config file at it – that way you can let YUM pull in the dependencies instead of sinking into rpm-hell!

If you’re installing from RPM, you’ll need to install EPEL (for the dependencies) and then install the following packages:

yum install tk-8.4.13-5.el5_1.1.i386 unixODBC-2.2.11-7.1.i386 erlang-R12B-5.10.el5.i386

then install the package:

rpm -Uvh rabbitmq-server-2.2.0-1.noarch.rpm

If you’re installing from a yum repo, the following works:

yum install rabbitmq-server

(told you it was easier!)

Once RabbitMQ is installed, download the following plugins from the RabbitMQ site:

amqp_client-2.2.0.ez
rabbit_stomp-2.2.0.ez

and place them into /usr/lib/rabbitmq/lib/rabbitmq_server-2.2.0/plugins

Create /etc/rabbitmq/rabbitmq.conf with the following content:

SERVER_START_ARGS=”-rabbit_stomp listeners [{“0.0.0.0″,6163}]”

and restart RabbitMQ:

service rabbitmq-server restart

Configuring MCollective

I’m assuming that you’ve already got MCollective installed, if not, I just happen to have a handy guide to doing just that, so ignore the ActiveMQ stuff and come back once you’re ready to continue…

OK, sitting comfortably? Good, then I’ll continue! 🙂

The config for MCollective is simple:

  1. Set the plugin.stomp.host to the ip address of the server running RabbitMQ
  2. Set plugin.stomp.user to ‘guest’
  3. Set plugin.stomp.password to ‘guest’
  4. Make sure port 6163 is open on the RabbitMQ server’s firewall
  5. Restart MCollective
  6. Run mc-find-hosts and see all your servers! 🙂

I need to work out how to set the username/password to something other than guest, but the above should get you up and running at least!