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

Storm Appendix A


May 17, 2021 Storm getting Started


Table of contents


Appendix A

Install the Storm client

The Storm client allows us to use commands to manage the topology in the cluster. Follow these steps to install the Storm client:

  1. Downloading the latest stable version (https://github.com/nathanmarz/storm/downloads) from the Storm site is currently storm-0.8.1. ( The original text is storm-0.6.2, but it was already storm-0.8.1 at the time of translation)

  2. Unzip the downloaded files to the Storm shared directory /usr/local/bin/storm.

  3. Add the Storm directory to the PATH environment variable so that you don't have to enter a full path to execute Storm every time. I f we use /usr/local/bin/storm, execute the export PATH$PATH:/usr/local/bin/storm.

  4. Finally, create a Storm local profile: .storm/storm.yaml, and add the nimbus host in the configuration file in the following format:

    `nimbus.host:"我们的nimbus主机"`

Now you can manage the topology in your Storm cluster.

NOTE: The Storm client contains all the Storm commands you need to run a Storm cluster, but to run it you need to install some other tools and do some configuration. See Appendix B for details.

There are many simple and useful commands that can be used to manage the topology, and they can commit, kill, disable, and rebalance the topology.

The jar command is responsible for submitting the topology to the cluster and executing it, executing the main class through StormSubmitter.

storm jar path-to-topology-jar class-with-the-main arg1 arg2 argN   

Path-to-topology-jar is the full path to the topology jar file, which contains topological code and dependent libraries. Class-with-the-main is a class that contains the main method, which will be executed by StormSubmitter, with the remaining parameters as parameters of the main method.

We were able to suspend or deactive the running topology. When the topology is deactived, all distributed tuples are processed, but the nextTuple method of spouts is not called.

Deactivity topology:

storm deactivte topology-name  

Start a deactived topology:

storm activate topology-name  

To destroy a topology, you can use the kill command. I t destroys a topology in a secure manner, first deactivation of the topology and allowing the topology to complete the current data flow while waiting for topology messages. Kill a topology:

storm kill topology-name  

NOTE: When executing the kill command, you can specify the wait time after the topology deactivates by -w (wait seconds).

Rebalancing allows you to reassign cluster tasks. T his is a very powerful command. F or example, you add nodes to a running cluster. T he rebalance command deactivations the topology, then reassigns the workers after the corresponding timeout and restarts the topology. Rebalance the topology:

storm rebalance topology-name  

NOTE: A Storm client that executes without parameters can list all Storm commands. For a complete description of the command, see: https://github.com/nathanmarz/storm/wiki/Command-line-client.