/etc/init.d/mongrel-cluster(1) init script for Mongrel Cluster


/etc/init.d/mongrel-cluster {start|stop|restart|status}


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.

With mongrel working and our webapp directory prepared we can proceed with the mongrel_cluster configuration step:

  $ mongrel_rails cluster::configure -e production \

    -p 8000 -N 3 -c /var/www/apps/testapp -a \

    --user www-data --group www-data

This will write a configuration file in config/mongrel_cluster.yml. We have setup to run our cluster in production mode as the user www-data 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:

   $ 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

   $ mongrel_rails cluster::stop

Now, we need to set into mongrel_cluster init script configuration directory:

  $ mv /var/www/apps/testapp/config/mongrel_cluster.yml \


  $ ln -s /etc/mongrel_cluster/sites-available/testapp.yml \


And now, finally

$ /etc/init.d/mongrel_cluster start


Each application is configured with a file located in (or symlinked to) /etc/mongrel-cluster/sites-enabled. Each configuration file is a mongrel_cluster configuration file.


Mongrel_cluster adds the following new commands to mongrel_rails:

cluster::configure creates the cluster configuration file using mongrel_rails parameters
cluster::start start the cluster for one rails application
cluster::stop stop one cluster

The init script accept the following parameters:

start start all mongrel_cluster using configuration files in /etc/mongrel-cluster/sites-enabled
stop stop all mongrel_cluster using configuration files in /etc/mongrel-cluster/sites-enabled
status show the status of all mongrel_cluster
restart restart all mongrel_cluster using configuration files in /etc/mongrel-cluster/sites-enabled


Mongrel Cluster (http://mongrel.rubyforge.org/) was written by Bradley Taylor <[email protected]> This man page was written for the Debian Project by Filipe Lautert <[email protected]> using resources written by Zed Shaw <[email protected]>.