我刚刚学习了风暴,并测试了来自here的WordCount示例代码。它使用setDebug(true)
启用调试日志记录
但我对这些调试信息感到困惑:
13867 [storm.starter.WordCountTopology.main()] INFO backtype.storm.daemon.nimbus -
Setting new assignment for topology id word-count-1-1403745226:
#backtype.storm.daemon.common.Assignment{:master-code-dir "/tmp/4ef1358b-92ce-4051-a4ce-
b33a25ace66d/nimbus/stormdist/word-count-1-1403745226", :node->host {"47fdd74b-65e0-4650-
a000-f1f0418dd7c7" "ms-VirtualBox"}, :executor->node+port {[2 2] ["47fdd74b-65e0-4650-a000-
f1f0418dd7c7" 1027], [3 3] ["47fdd74b-65e0-4650-a000-f1f0418dd7c7" 1027], [4 4] ["47fdd74b-
65e0-4650-a000-f1f0418dd7c7" 1027], [5 5] ["47fdd74b-65e0-4650-a000-f1f0418dd7c7" 1027], [6
6] ["47fdd74b-65e0-4650-a000-f1f0418dd7c7" 1027], [7 7] ["47fdd74b-65e0-4650-a000-
f1f0418dd7c7" 1027], [8 8] ["47fdd74b-65e0-4650-a000-f1f0418dd7c7" 1027], [9 9] ["47fdd74b-
65e0-4650-a000-f1f0418dd7c7" 1027], [10 10] ["47fdd74b-65e0-4650-a000-f1f0418dd7c7" 1027],
[1 1] ["47fdd74b-65e0-4650-a000-f1f0418dd7c7" 1027]}, :executor->start-time-secs {[2 2]
1403745226, [3 3] 1403745226, [4 4] 1403745226, [5 5] 1403745226, [6 6] 1403745226, [7 7]
1403745226, [8 8] 1403745226, [9 9] 1403745226, [10 10] 1403745226, [1 1] 1403745226}}
...
14547 [Thread-6] INFO backtype.storm.daemon.supervisor - Launching worker with
assignment #backtype.storm.daemon.supervisor.LocalAssignment{:storm-id "word-count-1-
1403745226", :executors ([2 2] [3 3] [4 4] [5 5] [6 6] [7 7] [8 8] [9 9] [10 10] [1 1])} for
this supervisor 47fdd74b-65e0-4650-a000-f1f0418dd7c7 on port 1027 with id 80043f34-85af-
4862-840e-99a58b1cf1f5
...
16140 [Thread-6] INFO backtype.storm.daemon.executor - Loading executor count:[2 2]
16153 [Thread-6] INFO backtype.storm.daemon.task - Emitting: count __system ["startup"]
16155 [Thread-6] INFO backtype.storm.daemon.executor - Loaded executor tasks count:[2
2]
16182 [Thread-6] INFO backtype.storm.daemon.executor - Finished loading executor count:[2 2]
16186 [Thread-8-count] INFO backtype.storm.daemon.executor - Preparing bolt count:(2)
16198 [Thread-6] INFO backtype.storm.daemon.executor - Loading executor count:[3 3]
16198 [Thread-6] INFO backtype.storm.daemon.task - Emitting: count __system ["startup"]
16198 [Thread-6] INFO backtype.storm.daemon.executor - Loaded executor tasks count:[3
3]
16206 [Thread-8-count] INFO backtype.storm.daemon.executor - Prepared bolt count:(2)
16213 [Thread-6] INFO backtype.storm.daemon.executor - Finished loading executor count:
[3 3]
16217 [Thread-10-count] INFO backtype.storm.daemon.executor - Preparing bolt count:(3)
16221 [Thread-10-count] INFO backtype.storm.daemon.executor - Prepared bolt count:(3)
[1 1]
,[2 2]
...是什么意思?有人可以给我一些详细的解释。非常感谢。
答案 0 :(得分:4)
感谢您的评论,我在那里发现了一些有用的东西
在深入了解component
,node
,worker
,executor
,task
的概念后,我知道[1 1]
的含义。< / p>
:node->host {"47fdd74b-65e0-4650-a000-f1f0418dd7c7" "ms-VirtualBox"}
这意味着这里只有一个节点。节点ID为47fdd74b-65e0-4650-a000-f1f0418dd7c7
,响应主机ms-VirtualBox
。
:executor->node+port {[2 2] ["47fdd74b-65e0-4650-a000-f1f0418dd7c7" 1027],
...
执行程序是一个运行spout / bolt实例的线程,上面的句子显示了执行程序的位置。 [2 2]是执行者ID,它响应节点47fdd74b-65e0-4650-a000-f1f0418dd7c7
的{{1}}端口。
由于1027
包含代码段WordCountTopology
,并且有3个spout / bolt,因此spout / bolt的最大执行程序数为9(从conf.setMaxTaskParallelism(3);
到{{1 }})。 (在这种情况下,1个任务响应1个执行器)此外,另一个执行器([2 2]
)被生成,称为[10 10]
,它将跟踪元组树并检测何时完全处理了一个spout元组。因此,总共有10个执行者,从[1 1]
到acker
。