Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Quick Start

lusis edited this page Feb 20, 2011 · 1 revision

Noah Quickstart

(make sure redis is running)

Install

You can either do gem install noah, git clone git://github.com/lusis/Noah.git noah and do the bundle dance or download noah.war from the downloads link.

Setup

There is no specific configuration file in use anymore. Everything is configured via command-line options to the noah binary or stored in config.ru.

  • The instance of Redis is configured via the REDIS_URL env setting. This is honored by Ohm.
  • Redis DSN strings are in the format of "redis://hostname:port/db"
  • RACK_ENV is honored.
  • rake sample["redis://localhost:6379/2"] populates the locally running redis instance - db 2
  • rake spec runs the test suite (using 'redis://localhost:6379/3' for storing test data)

rake sample

Creating Host entry for 'localhost'
Create Service entry for redis
Create Service entry for noah
Creating Application entry for 'noah'
Creating Configuration entry for 'noah'
Creating sample entries - Host and Service
Creating sample entries - Application and Configuration
Setup successful!

Run it

There are three (well four) ways to run Noah

downloaded war file

You can either deploy the war file to an existing container (tomcat and Jetty6 tested) or run it in standalone mode using the embedded winstone server.

Please note that you'll need to set the environment variable REDIS_URL if you want to point to any Redis server OTHER than localhost:6379/0.

Using winstone

export REDIS_URL=redis://hostname:port/dbnumber
java -server [-d64] -jar noah.war [-httpPort=<portnumber>] [--prefix=<different context root>]

Winstone doesn't do ANY error checking on options passed to it. Please check carefully that you're using --var=value after the war file name.

Deploying to a container

Just copy noah.war to your webapps folder. It will be served from /noah unless you rename it to ROOT.war or create a context file (under Jetty)

config.ru

Edit config.ru to change the redis instance or rack environment.

bin/noah

The binary script in bin was created using Vegas. It accepts the familiar rack options as well as an option for specifying the redis url.

bin/noah -p 9292 -s thin -d -F -e production -r redis://localhost:6379/2
[2011-02-07 16:48:15 -0500] Starting 'noah'...
[2011-02-07 16:48:15 -0500] trying port 9292...
Couldn't get a file descriptor referring to the console
[2011-02-07 16:48:15 -0500] Running with Rack handler: Rack::Handler::Thin
>> Thin web server (v1.2.7 codename No Hup)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:9292, CTRL+C to stop

If you leave off -F, all information will be logged to $HOME/.vegas/noah. Run bin/noah -h for more options.

Please note on JRuby that the port setting does not work for some f'cking reason. Bug claims to have been fixed. Until then, when on Jruby run like so:

noah -F -d -r redis://localhost:6379/0

Example links

Noah Start Page

If you have Noah running, you can hit the above link for some links created by the setup samples.