在hadoop-env.sh中添加
#hadoop远程debug配置
#远程调试NameNode
export HADOOP_NAMENODE_OPTS="-agentlib:jdwp=transport=dt_socket,address=4488,server=y,suspend=y"
#远程调试DataNode
export HADOOP_DATANODE_OPTS="-agentlib:jdwp=transport=dt_socket,address=9888,server=y,suspend=y"
#远程调试ResourceManager
export YARN_RESOURCEMANAGER_OPTS="-agentlib:jdwp=transport=dt_socket,address=10888,server=y,suspend=y"
#远程调试NodeManager
export YARN_NODEMANAGER_OPTS="-agentlib:jdwp=transport=dt_socket,address=11888,server=y,suspend=y"
CDH集群要加到JVM启动参数里
具体细节在如下链接
https://silvermissile.github.io/2020/07/23/%E8%BF%9C%E7%A8%8B%E8%B0%83%E8%AF%95CDH%E7%9A%84NameNode/