Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Storm record-- HelloWorld of 6Murray-Storm

Shulou Source: shulou.com Published: 2022-06-03 04:22:42 10月04日 Update

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)

Tags: Directory run compile information project copy file project upper editor code parameter slogan command form location machine root directory partial faceted learning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Xiaomi MySQL vpn Microsoft