Tuesday, November 8, 2011

Running RabbitMQ 2.6 and 2.7 on Mac OS/X

AMQP is an open protocol for Asynchronous message queueing.  The number one implementation for AMQP is RabbitMQ.
 
I normally run RabbitMQ on my Mac in a Linux/Ubuntu VM  but I recently got a new Macbook Air that's limited to 4GB.  I wanted to run RabbitMQ native on the Macbook Air instead of the Linux virtual machine to save space and give me better performance when running tcServer, RabbitMQ and STS on this slightly smaller machine. 

Installation
RabbitMQ is written in Erlang.  The Mac doesn't come with Erlang so you have to install it. You can use Macports or Homebrew per the Rabbit installation instructions.  I'm lazy so I used Rudix  Erlang-Solutions which provides Erlang in neat Mac installation packages that put the files in /usr/local /usr/bin. (The rudix version of Erlang went away over the weekend of 11/12/2011). 
  1. Download the img/package mentioned above and install it like any other .img file.
  2. Download RabbitMQ and unpack it into some working directory.
  3. cd into the RabbitMQ sbin directory.
  4. Start the server with sudo ./rabbitmq-server
  5. Use the sudo sbin/rabbitmqctl status command to see the status of the broker.
You now have a running RabbitMQ broker with only administrative exchanges and no queues configured.  You should now stop that server if you want to install the optional Web Management console or any other plugin.

Web Management Console
The web management console makes troubleshooting and experimentation easier. The steps for configuring plugins differ based on the version. 

Users access the web management console using URL http://localhost:55672/mgmt/. The default username and password are guest/guest. The console uses JavaScript so make sure you have JavaScript enabled for that web site.

Rabbit 2.6 
The plugins must be manually downloaded and installed in Rabbit 2.6
  1. Download the RabbitMQ management console components from the plugins page.  Download the plugins and copy them into RabbitMQ the plugins directory. Each of the plugins has a .ez file extension. The console plug-in requires 6 components at the time of this blog posting.
  2. Restart the RabbitMQ server. You should see the plugins load in the console output.
  3. Connect to the management console with a web browser and log in.
Rabbit 2.7 
The plugins are installed but not enabled for RabbitMQ 2.7.  You manually enable plugins with the new sbin/rabbitmq-plugins command.  First bring down your RabbitMQ server you started above.
  1. Create the location where the config file will be generated sudo mkdir /etc/rabbitmq
  2. cd into <rabbitmq_home>/sbin
  3. run sudo ./rabbitmq-plugins enable rabbitmq_management to create the config file and add this plugin. Note that no plug-in version numbers are specified. You should see that it adds all of the necessary dependencies.  A core dump probably means you forgot to use "sudo"
  4. Start the RabbitMQ server as you did in the previous steps.
  5. Connect to the management console with a web browser and log in.

Conclusion
You should now have a running server with the optional web console configured and loaded.  Use the previous section as a guide if you want to add additional plug-ins.  See the Rabbit tutorials for examples on how you can use the RabbitMQ server configured above.



2 comments:

  1. Thanks man, helped me out with 2.6

    ReplyDelete
  2. Thanks for the best blog.it was very useful for me.keep sharing such ideas in the future as well. Thanks for giving me the useful information. I think I need it!
    Happy Wheels , FNAF World , Five Nights At Freddy's

    ReplyDelete