Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Storm Appendix C


May 17, 2021 Storm getting Started


Table of contents


Appendix C

Install a practical example

Some of the latest versions of the software have changed, and the translation will not be translated exactly as original, but will list the latest version of the software.

First, clone this example from the URL of GitHub below:

> git clone git://github.com/storm-book/examples-ch06-real-life-app.git  

src/main

The source code that contains the topology

src/test

A test case that contains a topology

Webapps directory

A web .js Node can perform topology apps

.
├── pom.xml
├── src
│ ├── main
│ │ └── java
│ └── test
│ └── groovy
└── webapp

Install Redis

The installation of Redis is fairly simple:

  1. The latest stable version is 2.8.9 when translated from the Redis site.
  2. Unzip
  3. Run make, and make install.

The above command compiles Redis and creates an executable file in the PATH directory.

More information is available on the Redis website, including relevant command documentation and design concepts.

Install the Node .js

Installing node .js is also simple. Download the http://www.nodejs.org/#download version of Node from the .js source code.

The current latest version is v0.10.28

Download complete, unzip, execute

<b>./configure</b>
<b>make</b>
<b>make install</b>  

More information is available from the official site, including how to install Node .js platforms.

Build and test

In order to build this example, you need to start redis-server first

nohup redis-server &

Then execute the mvn command to compile and test the app.

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

Run the topology

After the redis-service is started and successfully built, the topology is started at The LocalCluster.

java -jar target/storm-analytics-0.0.1-jar-with-dependencies.jar

After you start the topology, start the Node .js web app with the following commands:

node webapp/app.js

NOTE: Topology and Node .js block each other. Try to run them at different terminals.

Demonstrate this example

Enter in the http://localhost:3000/ demonstrating this example!

About the author

Jonathan Leibiusky, Mercado Libre's leading research and developer, has been working in software development for more than 10 years. He has contributed source to a number of open source projects, including "Jedis," which is widely used in VMware and SpringSource.

Gabriel Eisbruch, a computer science student, has been an architect at Mercadolibre (NASDAQ MELI) since 2007. M ainly responsible for research and development of software projects. Last year, he was responsible for big data analytics, implementing hadoop clusters for MercadoLibre.

Dario Simonassi has more than 10 years of experience in software development. S ince 2004, he has been responsible for the operation and performance of large sites. He is now the chief architect of Mercado Libre (NASDAQ MELI), leading the company's team of architects.