GithubHelp home page GithubHelp logo

edwardt / mongrel_cluster Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kyusik/mongrel_cluster

1.0 3.0 0.0 411 KB

Updated for Ruby 1.9. 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.

License: Other

mongrel_cluster's Introduction

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.

NOTE: this is an unofficial fork of mongrel_cluster to get it working under ruby 1.9. A new dependency is an updated mongrel v 1.1.6 which has also been made ruby 1.9 compatible. If you are using ruby 1.8, you don’t need this version.

If you will use this version of mongrel_cluster on ruby 1.9, you will need to install v 1.1.6 of mongrel, which you can do in your environment.rb as follows: config.gem “mongrel”, :version => ‘1.1.6’, :source => ‘gems.rubyinstaller.org

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 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.

On Capistrano 2 you get then get the following tasks:

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.

On Capistrano 1 you get the same tasks, but without the namespace:

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.

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

mongrel_cluster's People

Contributors

kyusik avatar

Stargazers

edwardt avatar

Watchers

edwardt avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.