Mongrel Cluster
August 7, 2007 by anandmuranal
Mongrel_cluster is a GemPlugin that wrappers the mongrel HTTP server and simplifies the deployment of webapps using a cluster of mongrel servers. Mongrel_cluster will conveniently configure and control several mongrel servers, or groups of mongrel servers, which are then load balanced using a reverse proxy solution. Typical load balancing reverse proxies include:
- Apache – flexible and complex
- Lighttpd – development has stalled
- Pound – Simple and SSL capable
- Pen/Balance – Simple
Mongrel Cluster Setup
With mongrel working and our webapp directory prepared we can proceed with the mongrel_cluster configuration step:
$ sudo mongrel_rails cluster::configure -e production
-p 8000 -N 3 -c /var/www/apps/testapp -a 127.0.0.1
--user mongrel --group mongrel
This will write a configuration file in config/mongrel_cluster.yml. We have setup to run our cluster in production mode as the user mongrel and will start 3 mongrel servers listening on ports 8000, 8001, and 8002. Now, lets do a quick test of what we have setup so far:
$ sudo mongrel_rails cluster::start
Checking our host on ports 8000, 8001, and 8002 we should now be able to see our test application. We can stop all of those mongrels with sudo mongrel_rails cluster::stop.
For More Information Click Here