---
name: "mongrel-cluster"
section: "1"
platform: "linux"
package: "mongrel-cluster"
version: "1.0.5-5"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/mongrel-cluster"
---

# mongrel-cluster(1)

init script for Mongrel Cluster

## NAME

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

## SYNOPSIS

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

## DESCRIPTION

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 127.0.0.1 \\\
\
     \--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 \\\
\
     /etc/mongrel\_cluster/sites-available/testapp.yml\
\
   $ ln -s /etc/mongrel\_cluster/sites-available/testapp.yml \\\
\
     /etc/mongrel\_cluster/sites-enabled/001-testapp.yml

And now, finally

$ /etc/init.d/mongrel\_cluster start

## CONFIGURATION

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.

## OPTIONS

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

## SEE ALSO

[**mongrel\_rails**(1)](/mongrel_rails/1.md),[**rails**(1)](/rails/1.md)\

## AUTHOR

Mongrel Cluster (http://mongrel.rubyforge.org/) was written by Bradley Taylor \<bradley@fluxura.com\> This man page was written for the Debian Project by Filipe Lautert \<filipe@icewall.org\> using resources written by Zed Shaw \<zed@zedshaw.com\>.
