public
Fork of KirinDave/fuzed
Description: A new revision of Fuzed, the Erlang-based frontend for web apps. Check out the mailing list at http://groups.google.com/group/fuzed
Clone URL: git://github.com/tmm1/fuzed.git
tmm1 (author)
Thu Jun 19 23:18:08 -0700 2008
commit  b02c8cbac29ab7d51b74941dd33a5c624db5eb10
tree    a917cfd99a7bb13357df4748a73d7ea5ea2b5928
parent  e10fc83dc51e61bc82dfb276f01875571981f090
fuzed /
name age message
file .gitignore Sun May 04 20:33:26 -0700 2008 getting close to a full roundtrip [mojombo]
file LICENSE Thu Jun 05 16:55:45 -0700 2008 Added a clear License. Sorry. [KirinDave]
file README Thu Jun 05 16:34:10 -0700 2008 Merge branch 'master' of git://github.com/mojom... [KirinDave]
file Rakefile Thu Jun 19 23:18:08 -0700 2008 fix rake doc task (./doc doesn't exist) [tmm1]
directory bin/ Mon Jun 09 18:15:49 -0700 2008 master now has the choice of either yaws or moc... [abhay]
directory conf/ Fri May 02 23:17:18 -0700 2008 Massive move, removing id2. [KirinDave]
directory ebin/ Sat Jun 14 11:13:10 -0700 2008 merge conflicts with yaws changes [mojombo]
directory elibs/ Sat Jun 14 20:13:40 -0700 2008 pid file option for frontend [mojombo]
directory etest/ Mon Jun 09 18:15:49 -0700 2008 master now has the choice of either yaws or moc... [abhay]
directory include/ Mon Jun 16 23:49:44 -0700 2008 catch any peername errors [mojombo]
directory log/ Mon Jun 02 22:49:52 -0700 2008 adding log directory [abhay]
directory rlibs/ Tue Jun 17 00:13:46 -0700 2008 actually allow use of rails json this time [mojombo]
directory rtest/ Fri May 02 23:13:41 -0700 2008 Renaming all instances of id2 to fuzed. [KirinDave]
directory test/ Mon Jun 16 23:07:46 -0700 2008 pass REMOTE_ADDR through [mojombo]
directory web/ Sun May 25 16:40:09 -0700 2008 Working on a better, more configurable frontnet... [KirinDave]
README
fuzed
    by Dave Fayram        <dfayram at powerset dot com>,
       Tom Preston-Werner <tom at powerset dot com>,
       Abhay Kumar        <abhay at powerset dot com>
       
    Webiste:      http://fuzed.rubyforge.org
    Mailing List: http://groups.google.com/group/fuzed

== Summary

Fuzed is an Erlang-based clustering system designed to let several
single-threaded processes (which may or may not be reliable) form 
into a pool which can serve requests to remote hosts. These resources
need not be homogeneous, Fuzed breaks them up into homogeneous pools
internally and serves out requests without "crossing the streams"
of different software/versions of software.

This is a release of Powerset's internal clustering software which
has been adapted for use with Rails, but see the generic_json_responder
to see exactly how it is used internally.


== Dependencies

* Erlang: http://www.erlang.org (>= 5.6.1)
* Ruby: http://www.ruby-lang.org (>= 1.8.6)
* Ruby Gems: 
  * rake: http://rake.rubyforge.org (>= 0.8.1)
  * rack: http://rack.rubyforge.org (>= 0.3.0)
  * erlectricity: http://github.com/mojombo/erlectricity (>= 0.2.1)

== Installation

Fuzed is currently only available as a source distribution. A gem will be made
available shortly.

First, clone the source repo from GitHub. The following command will clone the
repo into a directory named 'fuzed' within your current working directory.

$ git clone git://github.com/KirinDave/fuzed.git

Move into the 'fuzed' directory and run 'rake' to build fuzed.

$ cd fuzed
$ rake

You should not see any error messages if the build was successful.

== Setting up a simple Rails cluster on a single machine

Every cluster starts with a 'master' node. From the fuzed root directory, run
the following to start a master. The command will drop you into interactive
mode for the Erlang runtime. It's best to work this way while you familiarize
yourself with the system as it will be easier to see any error messages that
reported.

$ bin/fuzed start -n master@volcano.local

Replace 'volcano.local' with your hostname. Note: 'localhost' will not work
here, it must be an externally addressable hostname. It's best to always name
your master node 'master'. It makes setting up frontend and backend nodes much
easier.

Next, start and attach a Rails 'frontend' node. This will bind to a TCP port
(default 8080) and serve static assets as well as direct dynamic requests to
your Rails node.

$ bin/fuzed frontend -z volcano.local -r test/app/public -s 'kind=rails' \
  -n f8080@volcano.local

Let's break this command down so you understand what each option specifies. -z
denotes the hostname of the master (must match what you used in your `fuzed
start` command. -r specifies the document root for static assets. -s specifies
a details list that will select the proper backend node. For a simple cluster,
leave this alone. -n names the node. Every node that joins a cluster must be
uniquely named. Here I've named it after the port that will be bound. Because
this is a single machine cluster, I use the same hostname as the master. In a
multi-machine setup, you will specify the hostname of the machine that is
running the node.

You should now be able to request a static asset from your cluster. Try
requesting:

http://localhost:8080/robots.txt

Now we'll need a 'rails' node to serve dynamic requests. The following command
will start a single Rails node.

$ bin/fuzed rails -z volcano.local --rails-root=test/app -n n1@volcano.local

Once again -z specifies the master hostname. --rails-root must point to the
Rails root of your app. -n names the node.

At this point, if all is well, you will have a fully assembled and operational
Rails cluster!