ZXXJPDA IntroductionSun Microsystem's Java Platform Debugger Architecture (JPDA) technology is a multi-tiered architecture that enables you to easily debug Java applications in a variety of environments. The JPDA consists of two interfaces (JVM Tool Interface and JDI), one protocol (Java Debug wire Protocol), and two software components (backend and front end) for merging them. It is designed to allow debuggers to be debugged in any environment. for a more detailed introduction, you can refer to using Eclipse to remotely debug Java applicationsJDWP SettingsThe JVM itself supports remote debugging, and Eclipse also supports JDWP, which simply loads the following parameters when the JVM of each module is started:
Dt_socket represents the use of socket transmissions. address=8000The JVM listens for requests on Port 8000, which is set to a non-conflicting port. server=yy indicates that the JVM being started is the debugger. If n, the JVM that starts is the debugger. suspend=yy indicates that the JVM that is started pauses the wait until the debugger is connected to the execution. Suspend=n, the JVM does not pause the wait.
need to add the process you want to debug at the end of the $hadoop_home/etc/hadoop/hadoop-env.sh file
#远程调试namenode
export hadoop_namenode_opts= "-agentlib:jdwp=transport=dt_socket,address=8888,server=y,suspend=y"
#远程调试datanode
export hadoop_datanode_opts= "-agentlib:jdwp=transport=dt_socket,address=9888,server=y,suspend=y"
#远程调试RM
export yarn_resourcemanager_opts= "-agentlib:jdwp=transport=dt_socket,address=10888,server=y,suspend=y"
#远程调试NM
export yarn_nodemanager_opts= "-agentlib:jdwp=transport=dt_socket,address=10888,server=y,suspend=y"
Eclipse Remote Debugging Hadoop code