There is a new hype: cloud computing. Your web site traffic grows? Add a new application server. Want to increase availability? Add a new web server. Among others Amazon offers a whole bunch of infrastructure to support these needs. But it is not enough to fire up a server. The web server should include apache, the app server should include tomcat. The deployment should be aware of the new app server. This is where Puppet, iClassify, and Capistrano come into play. Puppet does the configuration management, installs your desired web and app server.

Depending on the “server class” it automagically can install packages, configurations, etc. iClassify plugs into this nicely: each new server registers with iClassify, providing the vital information of itself (yes, its scriptable and there already is script for exposing all relevant EC2 data of an instance). Once tagged with a “server class” Puppet can do its work. iClassify nicely integrates with Capistrano, so deployment tasks can be rolled out through the result of searches in the iClassify database. “Deploy to all HOSTS in $CLOUD where hasTomcat=TRUE”.

Following is a writeup of the Puppet and iClassify installation on a Rightscale CentOS 5.0 Amazon EC2 ami:

It is mainly based on https://wiki.hjksolutions.com/display/IC/Install+Instructions, so credits go there :-)

Install iClassify

http://reductivelabs.com/trac/puppet/wiki/InstallationGuide
http://ifireball.wordpress.com/docs/howto-install-puppet-on-centos-50/

cd /etc/yum.repos.d
wget http://people.redhat.com/dlutter/yum/dlutter.repo

Enable the proper repository, edit the dlutter.repo file, find the [dlutter-rhel5] section and set enabled=1

vi dlutter.repo 

yum install puppet-server
yum install ruby-rdoc

Create a minimal manifest file in /etc/puppet/manifests with the following content:

# The name of the system running the file server

$server = "pmaster"

 node default {

}

vi /etc/puppet/manifests/minimal
/etc/init.d/puppetmaster start
chkconfig puppetmaster on

Install iClassify

http://github.com/adamhjk/iclassify/tree/master/INSTALL
https://wiki.hjksolutions.com/display/IC/Install+Instructions

install rails and rake (already on ami)
review this (capistrano tasks for puppet/iclassify):

http://reductivelabs.com/trac/puppet/wiki/RegenerateSSL

recipes for puppet (should try out the iclassify thing):
http://github.com/apenney/puppet/tree/master

contact: If you have any specific questions there’s an irc channel on freenode (#puppet), and the major developers are all there and it’s pretty easy to get advice (if it’s in the work week between 9-5est I’ll always help if I can.)

presentations:
http://reductivelabs.com/trac/puppet/wiki/PuppetPresentations

other blog entries
http://plathrop.tertiusfamily.net/blog/category/tools/puppet/
http://www.red91.com/2008/07/09/puppet-setup-test-notes

 

install iClassify

gem list|grep rails
gem list|grep rake

install  builder, UUID Tools. Mongrel, Highline

gem install builder uuidtools mongrel highline ruby-net-ldap
yum install mysql mysql-devel

/etc/init.d/mysqld start
/usr/bin/mysqladmin -u root password 'mysql'
mysqladmin create iclassify_production -p
mysql iclassify_production -p
GRANT ALL ON iclassify_production.* TO 'iclassify'@'localhost' IDENTIFIED BY 'yourpass'
;

http://smangal.wordpress.com/2007/05/17/mysql-gem-on-centos/
gem install mysql -- --with-mysql-include=/usr/include/mysql --with-mysql-lib=/usr/lib/mysql

wget https://wiki.hjksolutions.com/download/attachments/295039/mongrel_runit-0.2.0.gem
gem install mongrel_runit-0.2.0.gem 

yum install git
yum install facter

http://rubyworks.rubyforge.org/installation/centos.html
wget http://rubyworks.rubyforge.org/RubyWorks.repo

RubyWorks.repo /etc/yum.repos.d/
change baseurl to (does read to 5.0 –> no web site)

baseurl=http://rubyworks.rubyforge.org/redhat/5/RPMS/$basearch
in
vi /etc/yum.repos.d/RubyWorks.repo
yum install runit

install IClassify

choose your ICLASSIFY_HOME directory
git clone git://git.hjksolutions.com/iclassify iclassify
cd iclassify/

rake iclassify:install ICBASE=/srv/iclassify ICUSER=apache ICGROUP=apache DBUSER=iclassify DBPASS=yourpass
chown -R apache:apache /srv/iclassify/*

mkdir /etc/mongrel_runit
cp /srv/iclassify/examples/mongrel_runit_iclassify.yml /etc/mongrel_runit/iclassify.yml

change user and group to apache in
/etc/mongrel_runit/iclassify.yml

mongrel_runit -c /etc/mongrel_runit/iclassify.yml create
chmod a+x /etc/init.d/mongrel_runit
ln -s /etc/init.d/mongrel_runit /etc/init.d/iclassify
/etc/init.d/iclassify -v status

mkdir -p /etc/sv/iclassify-solr/log/main
cp /srv/iclassify/examples/solr-run /etc/sv/iclassify-solr/run
cp /srv/iclassify/examples/solr-log /etc/sv/iclassify-solr/log/run
chmod a+x /etc/sv/iclassify-solr/run /etc/sv/iclassify-solr/log/run
ln -s /etc/sv/iclassify-solr /var/service

sv binary is in sbin (in this centos install)
ln -s /usr/sbin/sv /etc/init.d/iclassify-solr

change JAVA_HOME to /usr/java/default
vi /etc/sv/iclassify-solr/run

solr logfiles are in
/var/service/iclassify-solr/log/main/current 

for apache:

add a /etc/httpd/conf.d/iClassify.conf

<VirtualHost *:*>
ProxyPass / http://localhost:5000/
ProxyPassReverse / http://localhost:5000/
</VirtualHost> 

in your ICLASSIFY_HOME

./bin/icagent -d ./icangent -s http://localhost:5000 -n

to show the status

and if it fit your needs:

./bin/icagent -d ./icangent -s http://localhost:5000

now you are ready. log into the iclassify server and enjoy :-)

install the ssl for iClassify:

http://www.electrictoolbox.com/mod-ssl-apache-centos-5/

 

Interested in Cloud or Chef Trainings? Have a look at our Commandemy Trainings page. Need help migrating to the cloud? Check out Infralovers.

comments powered by Disqus
Blog Tags