Manage Storm Topologies
When you create a topology and launch it, that topology becomes active. When the topology is no longer needed, you can kill or deactivate it. You can also rebalance a topology. These actions can be performed through the Storm UI or from the command line.
Activating a Topology
- To activate a topology from the Storm UI, click the Activate button under Topology actions.
- To activate a topology from the command line:
storm activate <topology-name>
Rebalancing Workers for a Topology
Sometimes you might want to spread out the workers for a topology so they are more evenly distributed across the available nodes. For example, suppose you have a 10-node cluster running four workers per node, and then you add another 10 nodes to the cluster. Instead of killing the topology and resubmitting it, Storm can rebalance the workers for the running topology so that each node runs two workers.
Rebalance first deactivates the topology for the duration of the message timeout (which
you can override with the -w
option) and then redistributes the workers
evenly around the cluster. The topology then returns to its previous state of activation
(so a deactivated topology is still deactivated and an activated topology returns to
being activated).
- To rebalance workers from the Storm UI, click the Rebalance button under Topology actions.
- To rebalance workers from the command
line:
storm rebalance <topology-name>
Deactivating a Topology
- To deactivate a topology from the Storm UI, click the Deactivate button under Topology actions.
- To deactivate a topology from the command
line:
storm deactivate <topology-name>
Killing a Toplogy
When you kill a topology, Storm first deactivates the topology’s spouts for the duration of the topology’s message timeout. This allows all messages to finish processing. Storm then shuts down the workers and cleans up their state.
- To kill a topology from the Storm UI, click the Kill button under Topology actions.
- To kill a topology from the command
line:
storm kill <topology-name> [-w <wait-time-secs>]
To override the length of time Storm waits between deactivation and shutdown, specify the
-w
option.