如何通过eclipse在本地集群/模式下调试Apache Storm [英] How to debug Apache Storm in Local Cluster/Mode through eclipse

查看:32
本文介绍了如何通过eclipse在本地集群/模式下调试Apache Storm的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用以下问答,我设法通过 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"

当我将拓扑提交给 Storm 以运行(在集群中)时,我可以在我的编辑器中设置断点和查看变量.

When I submit a Topology to storm to run (in a cluster), I can set breakpoints and view variables in my editor.

但是当我尝试在本地运行它时(在 本地模式),我好像无法连接(Connection Refused)——通过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 中.点击这里查看

更多关于 Storm crawler 如何启动 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆