如何通过Eclipse在本地集群/模式下调试Apache Storm [英] How to debug Apache Storm in Local Cluster/Mode through eclipse
问题描述
使用以下问答,我设法通过Eclipse在Apache Storm集群(本地运行)上启用了调试功能. 如何在Eclipse中调试Apache Storm?
Using the following Q&A I managed to get debugging enabled through eclipse on an Apache Storm cluster (running locally). How to debug Apache Storm in Eclipse?
我的conf/storm.yaml
包含以下行以在工作程序节点上启用调试:
My conf/storm.yaml
has the following line to enable debugging on the worker nodes:
worker.childopts: "-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=y"
当我提交要在集群中运行的拓扑以进行风暴时,可以在编辑器中设置断点并查看变量.
When I submit a Topology to storm to run (in a cluster), I can set breakpoints and view variables in my editor.
但是当我尝试在本地运行时(在本地模式中) ,我似乎无法通过Eclipse连接(拒绝连接).
But when I try to run it locally (In Local Mode), I can't seem to connect (Connection Refused) - through eclipse.
# I'm using storm crawler, I submit a topology like so:
storm jar target/storm-crawler-core-10.6-SNAPSHOT-jar-with-dependencies.jar \
com.digitalpebble.storm.crawler.CrawlTopology \
-conf crawler-conf.yaml \
-local
# ^ The `-local` runs it in a `LocalCluster`
# If I submit it to my actual cluster (without -local), I can debug it through eclipse.
# View the pastebin for all the output : http://pastebin.com/PEdA7fH0
我已将上述命令的所有输出包含到pastebin中.点击此处查看
有关风暴爬网程序如何启动LocalCluster的更多信息.
我希望能够在本地模式下进行调试,这样我就可以在命令行中看到输出(在我通过设置的断点的途中),并迅速进行更改并重新运行,以基本上加快我的开发速度流.
I want to be able to debug in local mode so I can see the output in the command line (as I make my way through the breakpoints I set) and quickly make changes and re-run, basically to speed up my development flow.
推荐答案
如果在本地模式下运行,则不涉及辅助JVM,即,没有启动辅助进程.因此,您的worker.childopts
设置没有任何作用.
If you run in local mode, there is no worker JVM involved, ie, no worker process is stared. Thus, your worker.childopts
settings do not have any effect.
在Eclipse中进行调试的最简单方法是在Eclipse中(而不是在命令行中)提交/启动拓扑.您的类CrawlTopology
具有一个main
方法,因此您可以直接在Eclipse中执行它(当然是在调试模式下).您无需指定jar文件名.只需在Eclipse运行配置中指定选项-conf crawler-conf.yaml -local
.
The easiest way to debug within Eclipse it to submit/start the topology within Eclipse instead of command line. Your class CrawlTopology
has a main
method, thus you can just execute it directly in Eclipse (of course in debug mode). You don't need to specify a jar file name. Just specify your options -conf crawler-conf.yaml -local
in your Eclipse run configuration.
这篇关于如何通过Eclipse在本地集群/模式下调试Apache Storm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!