Eclipse remote debugging of hadoop code
ZxxJPDA introduction Sun Microsystem's Java Platform Debugger Architecture (JPDA) technology is a multi-layer Architecture that allows you to easily debug Java applications in various environments. JPDA consists of two interfaces (JVM Tool Interface and JDI), one Protocol (Java Debug Wire Protocol), and two software components (backend and front-end) used to merge them. It is designed to allow debugging personnel to debug in any environment. For more details, refer to the remote debugging of Java application JDWP using Eclipse to set JVM to support remote debugging. Eclipse also supports JDWP, you only need to load the following parameters when the JVM of each module is started:
Dt_socket indicates that socket transmission is used. Address = 8000JVM listens for requests on port 8000. Set this parameter to a non-conflicting port. Server = yy indicates that the started JVM is debugged. If it is n, the JVM started is the debugger. Suspend = yy indicates that the started JVM will pause and wait until the debugger is connected. If suspend is n, the JVM does not pause the wait.
You need to add the process you want to debug at the end of the $ HADOOP_HOME/etc/hadoop/hadoop-env.sh File
# Remote namenode debuggingExport HADOOP_NAMENODE_OPTS = "-agentlib: jdwp = transport = dt_socket, address = 8888, server = y, suspend = y"# Remote debugging of datanodeExport HADOOP_DATANODE_OPTS = "-agentlib: jdwp = transport = dt_socket, address = 9888, server = y, suspend = y"# Remote debugging RM
Export YARN_RESOURCEMANAGER_OPTS = "-agentlib: jdwp = transport = dt_socket, address = 10888, server = y, suspend = y"# Remote debugging NM
Export YARN_NODEMANAGER_OPTS = "-agentlib: jdwp = transport = dt_socket, address = 10888, server = y, suspend = y"