问题
Let's say that I have 2 spouts and 3 bolts in Storm cluster and there are two worker nodes. Will be these spouts and bolts shared among these workers (for example first worker has 1 spout and 2 bolts, the second has 1 spout and 1 bolt) or each worker has 2 spouts and 3 bolts which ends up with 4 spouts and 6 bolts in whole cluster?
回答1:
Spout and bolt are shared by all your cluster (so worker).
If you have 2 spouts and 3 bolts for 2 workers, they will be balanced between your 2 workers. You can use the ui (./nimbus ui) to visualise that :).
回答2:
In storm, a supervisor has multiple worker(processes) slots. By default Storm uses even scheduler to schedule #executors(threads that execute spouts/bolt logic) on #worker_slots that are available. You can find the code to different scheduler implementations here.
来源:https://stackoverflow.com/questions/20313177/how-bolts-and-spouts-are-shared-among-workers