How to debug Apache Storm in Local Cluster/Mode through eclipse

前端 未结 3 1639
猫巷女王i
猫巷女王i 2021-01-16 12:44

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?

My

相关标签:
3条回答
  • 2021-01-16 13:19

    We can debug Storm Topology like any other java code in Eclipse. I launch my topology with in Eclipse itself using LocalCluster mode. I'm able to debug ShellBolts, Trident bolts etc.

    In addition I also have storm-core added as project in my Eclipse (instead of maven dependency), which enables me to debug and understand whats happening inside storm. Useful to better track Tuple acknowledgements, emit handlers, anchors, timeouts, exceptions etc.

    0 讨论(0)
  • 2021-01-16 13:32

    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.

    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.

    0 讨论(0)
  • 2021-01-16 13:32

    In local mode, you can use e.g.

    export STORM_JAR_JVM_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=localhost:8000"
    

    before calling the storm jar command to debug remotely with Eclipse.

    0 讨论(0)
提交回复
热议问题