storm 并行度

1个worker进程运行的是1个topology的子集(注:不会出现1个worker为多个topology服务)。1个worker进程会启动1个或多个executor线程来运行1个topology的component(spout或bolt)。因此。1个运行中的topology就是由集群中多台物理机上的多个worker进程组成的。


executor是1个被worker进程启动的单独线程。每一个executor仅仅会执行1个topology的1个component(spout或bolt)的task(注:task能够是1个或多个,storm默认是1个component仅仅生成1个task,executor线程里会在每次循环里顺序调用全部task实例)。


task是终于执行spout或bolt中代码的单元(注:1个task即为spout或bolt的1个实例,executor线程在执行期间会调用该task的nextTuple或execute方法)。topology启动后。1个component(spout或bolt)的task数目是固定不变的。但该component使用的executor线程数能够动态调整(比如:1个executor线程能够执行该component的1个或多个task实例)。

这意味着。对于1个component存在这种条件:#threads<=#tasks(即:线程数小于等于task数目)。默认情况下task的数目等于executor线程数目,即1个executor线程仅仅执行1个task。
默认情况下,一个supervisor节点会启动4个worker进程。

每一个worker进程会启动1个executor。每一个executor启动1个task。

原文地址:https://www.cnblogs.com/jzssuanfa/p/7146920.html