mongrel_cluster provides management tools for running Mongrel behind a reverse-proxy/load balancer. It is an extraction from Rails Machine, a deployment service and Ruby library that simplifies Rails application deployment. This release fixes bugs and adds a Capistrano task library.

Changes:

-changed pid file format to include port

-only write configuration options that are explicitly specified or required.

-removed some validation rules and delegate to mongrel_rails.

-added Capistrano task library.

Please rerun mongrel_rails cluster::configure to ensure smooth operation.

Capistrano Recipe

Add to config/deploy.rb:

require 'mongrel_cluster/recipes'
Example usage:
cap -a configure_mongrel_cluster
Variables
mongrel_servers: Number of Mongrel servers to start.
mongrel_port: Starting port to bind to.
mongrel_address: Address to bind to.
mongrel_environment: Rails environment to run as.
mongrel_config: Path to config file.
use_sudo: Whether or not tasks that can use sudo, ought to use sudo. Capistrano defaults to true.
Tasks (performed on :app role)
configure_mongrel_cluster: Configure the cluster with variables. Uses sudo if use_sudo is true.
start_mongrel_cluster: Start Mongrel processes on the app server. Uses sudo if use_sudo is true.
stop_mongrel_cluster: Stop the Mongrel processes on the app server. Uses sudo if use_sudo is true.
restart_mongrel_cluster: Restart the Mongrel processes on the app server. Uses sudo if use_sudo is true.
restart: Calls restart_mongrel_cluster to allow Mongrel to be used with the standard Capistrano deploy task.
spinner: Calls start_mongrel_cluster to allow Mongrel to be used with the standard Capistrano cold_deploy task.

Good luck and let me know how it works for ya!

3 Comments

Rockin'
Awesome. Thanks for this!
Hi There.. We really dig your mongrel_cluster wrapper, however I've discovered a bug (or so I think). We currently utilize tasks in Capistrano to define multiple deployment environments. For example, we define a stage task that sets different deploy_to variables and roles, etc. Whenever we set deploy_to from within a task, the mongrel_cluster recipes don't seem to see that, so they default to /u/apps/#{application} instead of the value of deploy_to. Moving the deploy_to out of a task, it works fine. I peaked at your recipes and didn't find an obvious solution. Any suggestions? Thank you, jereme

Leave a Comment

back to top

micro theme by seaofclouds, and powered with Mephisto