Using Chef Server with RabbitMQ and STOMP.

Joe Williams - - February 03, 2009

I decided to play around with RabbitMQ and chef (Opscode recently released new version) this afternoon. My main objective was to see if I could replace stompserver with something a bit more robust. In this case RabbitMQ and it’s STOMP plugin, the following is a basic outline of what I did. Please note that this was done on a Ubuntu 8.10 machine, if you are using another non-apt distro you will likely need to adjust the package installation commands and etc.

The first thing that needs to be done, if you do not already have a working chef/chef-server/ohai installation, is to get one up and running. If you already have a working install you should be able to skip down to the Erlang install portion and start from there.

Installing all this is pretty basic, check out the instructions. You should end up with a working installation with chef-server using stompserver (which we will be replacing) and couchdb. Here’s what I did:

sudo apt-get install ruby ruby1.8-dev rubygems libopenssl-ruby1.8 build-essential wget
wget http://rubyforge.org/frs/download.php/45904/rubygems-update-1.3.1.gem
sudo gem install rubygems-update-1.3.1.gem
sudo /var/lib/gems/1.8/bin/update_rubygems
sudo rm /usr/bin/gem
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
sudo gem sources -a http://gems.opscode.com
sudo gem install chef ohai chef-server
apt-get install couchdb

I then added in my configuration for chef-server:

vi /etc/chef/server.rb

#
## Chef Server Config File
##
#
log_level :info
log_location STDOUT
ssl_verify_mode :verify_none
registration_url “http://localhost:4000″
openid_url “http://localhost:4000″
template_url “http://localhost:4000″
remotefile_url “http://localhost:4000″
search_url “http://localhost:4000″
cookbook_path [ “/var/localhost/site-cookbooks”, “/var/localhost/cookbooks” ]
merb_log_path “/var/log/localhost-server-merb.log”

Chef::Log::Formatter.show_time = false

Since I am using a single machine for my chef server I started two chef-server instances, one with the defaults chef-server and another chef-server -p 4001. Two instances are needed for OpenID to work properly.

The next objective is to install Erlang.

sudo apt-get install erlang

Now for the RabbitMQ install, download the debian package from here and install it.

wget http://www.rabbitmq.com/releases/rabbitmq-server/v1.5.1/rabbitmq-server_1.5.1-1_all.deb
dpkg -i rabbitmq-server_1.5.1-1_all.deb

Next up is the RabbitMQ STOMP Plugin, get the latest from their repository. You also need the rabbitmq-server source tarball to build the STOMP plugin code off of.

apt-get install mercurial
cd /opt/
hg clone http://hg.rabbitmq.com/rabbitmq-stomp/
wget http://www.rabbitmq.com/releases/rabbitmq-server/v1.5.1/rabbitmq-server-1.5.1.tar.gz
tar zxvf rabbitmq-server-1.5.1.tar.gz
mv rabbitmq-server-1.5.1 rabbitmq-server
cd rabbitmq-server/
apt-get install python-simplejson
make
cd ../rabbitmq-stomp/
make

You will want to edit the config for rabbitmq to start up with the STOMP activated and then restart the service.

vi /etc/default/rabbitmq

SERVER_START_ARGS=’
-pa /opt/rabbitmq-stomp/ebin
-rabbit
stomp_listeners [{"0.0.0.0",61613}]
extra_startup_steps [{"STOMP-listeners",rabbit_stomp,kickstart,[]}]’

Finally, start everything up, minus stompserver.

/etc/init.d/couchdb start
/etc/init.d/rabbitmq-server restart
chef-server
chef-server -p 4001

After all that you should have a working chef-server using RabbitMQ/STOMP rather than stompserver. The rest is up to you.



Categories: Blogs  Joe Williams  

Comments

anonymous avatar

Hi to everyone I just want share few good links:

http://www.braunelectricshaver.net/forum/braun-forum/best-film-or-tv-adaption-of-a-stephen-ki-t45.html - best film or
http://www.mensdiamondweddingrings.net/forum/ring-forum/ - ring forum
<a >prefer to work</a>
<a >i am married</a>
<a >honest when</a>
<a >carfax report</a>
<a >braun forum 3</a>
<a >ross levinsohn</a>
<a >quality of a panasonic</a>
<a >ring forum 2</a>
<a >buying-nikon d90</a>
<a >ring forum</a>

Posted by canonlensesforum on 03 Jun 2009 at 04:06



 
anonymous avatar

Thanks so much for the guidance!

Posted by David L. Goldberg on 11 Aug 2009 at 03:52



 


Add comment

Name:

Email:

URL:

Smileys

Remember my personal information

Notify me of follow-up comments?