Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Storm record-- HelloWorld of 6Murray-Storm

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

HelloWorld of Storm Learning

1. Download Storm-start (https://github.com/nathanmarz/storm-starter/archive/master.zip))

2. Enter the download directory and extract the zip file.

3. Enter the decompressed file directory and modify m2-pom.xml (replace twitter4j-core and twitter4j-stream with the following section)

Org.twitter4j

Twitter4j-core

[2.2,)

Org.twitter4j

Twitter4j-stream

[2.2,)

4. Compile the project. Go to the project root directory and compile using mvn-f m2-pom.xml package

5. Copy the m2_pom.xml in the storm-starter directory as pom.xml, and put it in the same directory as m2_pom.xml.

6. Pack jar and mvn jar:jar.

If you still need to modify the project code, you can import eclipse.

Compile into an eclipse project using mvn eclipse:eclipse

Eclipse import project

7. Submit and run

Copy the jar package to the machine where Storm is located

After the compilation is correct, under the target directory in Storm-starter

Copy storm-starter-0.0.1-SNAPSHOT-jar-with-dependencies.jar to the specified directory

8. Execute the command:

. / storm jar / usr/soft/stormrun/storm-starter-0.0.1-SNAPSHOT-jar-with-dependencies.jar storm.starter.WordCountTopology test

When the test parameter is not added, the local form will be run, all the running information will be printed to the console, and you will see the print information at each step of the storm run.

5186 [Thread-26] INFO backtype.storm.daemon.executor-Processing received message source: spout:8, stream: default, id: {} [four score and seven years ago] four score and seven years ago-5194 [Thread-26] INFO backtype.storm.daemon.task-Emitting: split default [four] 5195 [Thread-26] INFO backtype.storm.daemon.task-Emitting: split default [score] 5196 [Thread-26] INFO backtype.storm.daemon.task-Emitting: split default [and] 5197 [Thread-22] INFO backtype.storm.daemon.executor-Processing received message source: split:6, stream: default Id: {}, [and] 5198 [Thread-22] INFO backtype.storm.daemon.task-Emitting: count default [and, 1] 5198 [Thread-26] INFO backtype.storm.daemon.task-Emitting: split default [seven] 5199 [Thread-20] INFO backtype.storm.daemon.executor-Processing received message source: split:6, stream: default, id: {} [four] 5200 [Thread-26] INFO backtype.storm.daemon.task-Emitting: split default [years] 5201 [Thread-18] INFO backtype.storm.daemon.executor-Processing received message source: split:6, stream: default, id: {}, [seven] 5201 [Thread-26] INFO backtype.storm.daemon.task-Emitting: split default [ago] 5201 [Thread-18] INFO backtype.storm.daemon.task-Emitting: count default [seven 1] 5205 [Thread-20] INFO backtype.storm.daemon.task-Emitting: count default [four, 1] 5205 [Thread-20] INFO backtype.storm.daemon.executor-Processing received message source: split:6, stream: default, id: {}, [score] 5205 [Thread-20] INFO backtype.storm.daemon.task-Emitting: count default [score, 1]

9. Check UI http://ip:8080 (the port number is 8080 by default, which can be modified, usually 9090)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report