Today I wanted to update our AMQP producer payload so I needed to have RabbitMQ installed and ready in my Vagrant virtual machine. We use Centos 6.

In our Vagrantfile:

config.vm.network :private_network, ip: "192.168.x.x"

The EPEL rabbitmq-server is in version 3.1.5 while the latest version (and the version where the plugin management command sits) is the 3.5.3.

So, in order to install the RabbitMQ server:

$ sudo yum install erlang
$ wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.5.3/rabbitmq-server-3.5.3-1.noarch.rpm
$ sudo rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc
$ sudo yum install rabbitmq-server-3.5.3-1.noarch.rpm

Done. Binaries are in /usr/sbin so you might update your PATH.

Start the server at boot:

$ sudo chkconfig rabbitmq-server on

Start the server:

$ sudo service rabbitmq-server start

If you need to access to the management plugin:

$ sudo rabbitmq-plugins enable rabbitmq_management
$ curl -I localhost:15672
HTTP/1.1 200 OK
Server: MochiWeb/1.0 (Any of you quaids got a smint?)
last-modified: Tue, 02 Jun 2015 13:37:12 GMT
Date: Tue, 02 Jun 2015 15:04:34 GMT
Content-Type: text/html
Content-Length: 1353

You can log in with the user guest only from localhost so if you need to log from your vagrant host, you'll need to add a new powerful user:

$ sudo rabbitmqctl add_user {user} {passwd}
$ sudo rabbitmqctl set_user_tags {user} administrator
$ sudo rabbitmqctl set_permissions -p / {user} ".*" ".*" ".*"

From there you can connect from 192.168.x.x:15672 and log with whatever {user} and {passwd} you set in the previous commands.

Easy right? Way easier when you can easily find this article.

Cheers and happy queueing!


Joris Berthelot