1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00
puma--puma/projects/mongrel_cluster
evanweaver e5ceebe3e9 mongrel_rails and mongrel_cluster support throttle/timeout appropriately
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@729 19e92222-5c0b-0410-8929-a290d50e31e9
2007-10-22 07:26:12 +00:00
..
bin support --clean flag 2007-10-11 07:38:16 +00:00
lib/mongrel_cluster mongrel_rails and mongrel_cluster support throttle/timeout appropriately 2007-10-22 07:26:12 +00:00
resources fixed ps for status, default path for pids 2007-02-21 16:14:14 +00:00
CHANGELOG changelog 2007-10-11 07:31:44 +00:00
COPYING updated copyright year 2007-07-10 19:44:34 +00:00
LICENSE updated copyright year 2007-07-10 19:44:34 +00:00
Manifest signed mongrel_cluster 2007-09-23 01:48:47 +00:00
Rakefile update dependency tree 2007-10-10 16:28:29 +00:00
README cap 2 recipes 2007-10-11 07:30:46 +00:00

== Mongrel Cluster Plugin

Tool to help start/stop/restart multiple mongrel servers to use behind a load balancer like Apache 2.2 (mod_proxy_balancer), Lighttpd, Pound, Pen or Balance. This plugin adds an option to specify a number of Mongrel servers to launch, a range of ports, and a configuration file for the cluster. Use "-h" to see command syntax.

Configure cluster and write configuration file:
  mongrel_rails cluster::configure  

Start cluster:
  mongrel_rails cluster::start

Restart cluster:
  mongrel_rails cluster::restart

Stop cluster:
  mongrel_rails cluster::stop

== Capistrano 1.0 Recipes

Add to config/deploy.rb:
  require 'mongrel_cluster/recipes'

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_conf: Path to conf file. Defaults to /etc/mongrel_cluster/app_name.conf
  mongrel_user: User to run mongrels in cluster as. Unset by default
  mongrel_group: Group to run mongrels in cluster as. Unset by default.

Tasks (performed on :app role)
  configure_mongrel_cluster: Configure the cluster with variables.
  start_mongrel_cluster: Start Mongrel processes on the app server.
  stop_mongrel_cluster: Stop the Mongrel processes on the app server.
  restart_mongrel_cluster: Restart the Mongrel processes on the app server by starting and stopping mongrel_cluster.
  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.

== Capistrano 2.0 Recipes

Add to config/deploy.rb:
  require 'mongrel_cluster/recipes_2'

Capistrano 2.0 uses namespaced tasks. The new task names are:
  mongrel:cluster:configure Configure the cluster with variables.
  mongrel:cluster:start: Start Mongrel processes on the app server.
  mongrel:cluster:stop: Stop the Mongrel processes on the app server.
  mongrel:cluster:restart: Restart the Mongrel processes on the app server by starting and stopping mongrel_cluster.
  deploy:restart: Calls mongrel:cluster:restart to allow Mongrel to be used with the standard Capistrano deploy task.
  deploy:start: Calls mongrel:cluster:start to allow Mongrel to be used with the standard Capistrano deploy task.
  deploy:stop: Calls mongrel:cluster:stop to allow Mongrel to be used with the standard Capistrano deploy task.

== Starting clusters at boot

1. Create mongrel_cluster conf directory (/etc/mongrel_cluster).
2. Assign ownership to your Capistrano user.
3. Copy the init.d script from this gem's resouces directory /etc/init.d.
4. chmod +x /etc/init.d/mongrel_cluster
5. Add to init.d startup. On RHEL/CentOS use: /sbin/chkconfig --level 345 mongrel_cluster on