Databases Reference
In-Depth Information
Installing Node.js
Installing Node.js is pretty straightforward. Download the latest Node.js source from
At the time of this writing, the latest version of NodeJS is
0.6.19
. Extract the content
of the file and run
./configure
,
make
, and
make install
.
You'll find more information on the official site, as well as documentation on how to
install Node.js on different platforms.
Building and Testing
In order to build the example, you should start the
redis-server
on your machine.
>nohup redis-server &
After that, run the
mvn
command to effectively compile and test the application.
>mvn package
...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 32.163s
[INFO] Finished at: Sun Jun 17 18:55:10 GMT-03:00 2012
[INFO] Final Memory: 9M/81M
[INFO] ------------------------------------------------------------------------
>
Running the Topology
Once the
redis-server
is running and the build is successful, start the topology running
in a
LocalCluster
.
>java -jar target/storm-analytics-0.0.1-jar-with-dependencies.jar
After the topology is started, you can start the
Node.js Web Application
by running the
following:
>node webapp/app.js
Topology and Node.js commands block eachother. Try running them
in different terminals.
Playing with the Example
Type
http://localhost:3000/
and start playing with the example!