Executing the topology from Command Prompt
Once the UI is visible and all the daemons are started, the topology can be submitted on Nimbus using the following command:
storm jar storm-starter-0.0.1-SNAPSHOT-jar-with-dependencies.jar storm.starter.WordCountTopology WordCount -c nimbus.host=localhost
The Storm UI with the WordCount
topology running in distributed mode is shown here. It depicts the topology state, uptime, and other details (we shall discuss the features of the UI in detail in a later chapter). We can kill the topology from the UI.
Tweaking the WordCount topology to customize it
Now that we have deployed the WordCount
topology in distributed mode, let's tweak the code in the bolts a bit to write WordCount
onto a file. To achieve this, we will proceed with the following steps:
- We intend to create a new bolt,
FileWriterBolt
, to achieve this. OpenWordCountTopology.java
and add the following snippet toWordCountTopology.java
:public static class FileWriterBolt extends BaseBasicBolt...