博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Storm 配置图文解析
阅读量:5831 次
发布时间:2019-06-18

本文共 2471 字,大约阅读时间需要 8 分钟。

Storm 配置图文解析

參考阅读:

p=959

==============================     |     sample-topology        |     |  ------------------------  |   Task 1           Task 2          Task 3     |  |   Worker Process 1   |  |     T1               T2              T3     |  |           +--------+ |  |    Spout     =>     Bolt      =>    Bolt     |  | +------+  | +----+ | |  | parallelism      parallelism     parallelism     |  | |  T3  |  | | T2 | | |  |    hint=2          hint=2          hint=6     |  | +------+  | +----+ | |  |     |  |           | +----+ | |  |    combined parallelism = 2 + 2 + 6 = 10     |  | +------+  | | T2 | | |  |     |  | |  T3  |  | +----+ | |  |  Each of the 2 worker processes will spawn 10/2=5 threads     |  | +------+  +--------+ |  |     |  |                      |  |    T1: parallelism hint = initial executors     |  | +------+  +--------+ |  |     |  | |  T3  |  |   T1   | |  |    T2: the T2 bolt was configured to use 2 executors and four tasks.     |  | +------+  +--------+ |  |        For this reason each executor runs two tasks for this bolt.     |  ------------------------  |     |                            |     |  ------------------------  |    Config conf = new Config();     |  |   Worker Process 2   |  |     |  |           +--------+ |  |    // run as 2 workers on 2 supervisors     |  | +------+  | +----+ | |  |    conf.setNumWorkers(2);     |  | |  T3  |  | | T2 | | |  |     |  | +------+  | +----+ | |  |    // T1: 2 executors for spout     |  |           | +----+ | |  |    topologyBuilder.setSpout("T1-spout", new T1Spout(), 2);     |  | +------+  | | T2 | | |  |     |  | |  T3  |  | +----+ | |  |    // T2: 2 executors for bolt with total 4 tasks     |  | +------+  +--------+ |  |    topologyBuilder.setBolt("T2-bolt", new T2Bolt(), 2)     |  |                      |  |        .setNumTasks(4).shuffleGrouping("T1-spout");     |  | +------+  +--------+ |  |    // T3: 6 executors for bolt (default 1 task for 1 executor)     |  | |  T3  |  |   T1   | |  |    topologyBuilder.setBolt("T3-bolt", new T3Bolt(), 6).shuffleGrouping("T2-bolt");     |  | +------+  +--------+ |  |     |  ------------------------  |    StormSubmitter.submitTopology("sample-topology", conf, topologyBuilder.createTopology());     ==============================

说明:

一个worker进程(process)会产生N个线程(executor),那么并行度(parallelism)就是全部线程的数目。setNumWorkers

任务(task)是线程运行的工作队列。线程的任务数说明线程的吞吐能力。一个线程的各个任务之间并非并发的。

setNumTasks

线程(executor)是运行任务的上下文环境。

參照上图理解各个配置的含义。

转载地址:http://wsedx.baihongyu.com/

你可能感兴趣的文章
Valid Parentheses
查看>>
windows下Python 3.x图形图像处理库PIL的安装
查看>>
【IL】IL生成exe的方法
查看>>
数据指标/表现度量系统(Performance Measurement System)综述
查看>>
GitHub宣布推出Electron 1.0和Devtron,并将提供无限制的私有代码库
查看>>
论模式在领域驱动设计中的重要性
查看>>
四、配置开机自动启动Nginx + PHP【LNMP安装 】
查看>>
Linux 目录结构及内容详解
查看>>
OCP读书笔记(24) - 题库(ExamD)
查看>>
.net excel利用NPOI导入oracle
查看>>
$_SERVER['SCRIPT_FLENAME']与__FILE__
查看>>
html5纲要,细谈HTML 5新增的元素
查看>>
Android应用集成支付宝接口的简化
查看>>
[分享]Ubuntu12.04安装基础教程(图文)
查看>>
django 目录结构修改
查看>>
win8 关闭防火墙
查看>>
CSS——(2)与标准流盒模型
查看>>
C#中的Marshal
查看>>
linux命令:ls
查看>>
Using RequireJS in AngularJS Applications
查看>>