简体   繁体   English

如何在调试模式下启动 Apache Zeppelin?

[英]How to start Apache Zeppelin in debug mode?

I need to start Zeppelin in debug mode in order to add breakpoints in Intellij to remote debug the code.我需要在调试模式下启动 Zeppelin,以便在 Intellij 中添加断点以远程调试代码。

How do I do this?我该怎么做呢? There is no documentation available on this.没有可用的文档。

You can set this property你可以设置这个属性

In zeppelin-env.sh在 zeppelin-env.sh 中

export ZEPPELIN_MEM="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8111" export ZEPPELIN_MEM="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8111"

Similarly you can do for interpreter-mem同样,你可以为 interpreter-mem 做

Only catch is you can remote debug only one intrepreter process since there are no unique properties for each interpreters.唯一的问题是您只能远程调试一个解释器进程,因为每个解释器没有唯一的属性。

有关调试的详细信息,请参阅如何贡献页面

First, let's update zeppelin-env.sh to properly set the configuration to get the JVM to start in debug mode.首先,让我们更新 zeppelin-env.sh 以正确设置配置以使 JVM 以调试模式启动。

Edit $ZEPPELIN_HOME/conf/zeppelin-env.sh Add the following to the file:编辑 $ZEPPELIN_HOME/conf/zeppelin-env.sh 将以下内容添加到文件中:

export ZEPPELIN_MEM="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8111"

Now that we have updated the zeppelin-env.sh, the next time Apache Zeppelin starts, it will be listening for a remote debugger on port 8111.现在我们已经更新了 zeppelin-env.sh,下次 Apache Zeppelin 启动时,它将在端口 8111 上监听远程调试器。

To debug an interpreter, update ZEPPELIN_INTP_MEM envrionment variable instead.要调试解释器,请改为更新 ZEPPELIN_INTP_MEM 环境变量。 But as Ram has already mention, it would only work for one interpreter, because of port conflict.但是正如 Ram 已经提到的,由于端口冲突,它只能对一个解释器起作用。

Configure IntelliJ IDE to connect and debug the remote Apache Zeppelin配置 IntelliJ IDE 以连接和调试远程 Apache Zeppelin

Go to Run->Edit Configuration Create a new remote configuration in your IntelliJ IDE:转到 Run->Edit Configuration 在您的 IntelliJ IDE 中创建一个新的远程配置: 截图 1

Configure IntelliJ to stop on exceptions配置 IntelliJ 以停止异常

Go to Run->View Breakpoints Enable 'Java Exception Breakpoints' Select condition checkbox, and add the following condition :转到 Run->View Breakpoints Enable 'Java Exception Breakpoints' Select condition 复选框,并添加以下条件:

!(this instanceof java.lang.ClassNotFoundException || 
  this instanceof java.util.MissingResourceException || 
  this instanceof javax.naming.NoInitialContextException || 
  this instanceof java.lang.NoSuchMethodException)

You should now have Exception breakpoints configured like:您现在应该将异常断点配置为: 断点截图

Full credit goes to Luciano Resende - see complete article here: http://lresende.blogspot.com/2016/08/launching-apache-zeppelin-in-debug-mode.html全部归功于 Luciano Resende - 请在此处查看完整文章: http : //lresende.blogspot.com/2016/08/launching-apache-zeppelin-in-debug-mode.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM