简体   繁体   中英

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.

How do I do this? There is no documentation available on this.

You can set this property

In zeppelin-env.sh

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

Similarly you can do for 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.

Edit $ZEPPELIN_HOME/conf/zeppelin-env.sh Add the following to the file:

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.

To debug an interpreter, update ZEPPELIN_INTP_MEM envrionment variable instead. But as Ram has already mention, it would only work for one interpreter, because of port conflict.

Configure IntelliJ IDE to connect and debug the remote Apache Zeppelin

Go to Run->Edit Configuration Create a new remote configuration in your IntelliJ IDE: 截图 1

Configure IntelliJ to stop on exceptions

Go to Run->View Breakpoints Enable 'Java Exception Breakpoints' Select condition checkbox, and add the following 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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