As explained in the previous section, one of the key features of Storm is that it allows us to modify the parallelism of a topology at runtime. The process of updating a topology parallelism at runtime is called rebalance. If we add new supervisor nodes to a Storm cluster and don't rebalance the topology, the new nodes will remain idle.
There are two ways to rebalance the topology:
Using the Storm Web UI
Using the Storm CLI
The Storm Web UI will be covered in detail in the next chapter. This section covers how we can rebalance the topology using the Storm CLI tool. The following is the command we need to execute on the Storm CLI tool to rebalance the topology:
bin/storm rebalance [TopologyName] -n [NumberOfWorkers] -e [Spout]=[NumberOfExecutos] -e [Bolt1]=[NumberOfExecutos] [Bolt2]=[NumberOfExecutos]
The rebalance
command will first deactivate the topology for the duration of the message timeout and then redistribute the workers evenly around the Storm...