1首先进入IntelliJ的Edit Configurations

2添加Remote


3设置服务器java vm的-agentlib:jdwp选项.[server]
1)//linux(建议使用)
export HADOOP_CLIENT_OPTS=-
agentlib:jdwp=transport=dt_socket,address=8888,server=y,suspend=y
2).在server启动java程序
hadoop jar HdfsDemo.jar com.it18zhang.hdfs.mr.compress.TestCompress
3).server会暂挂在8888.
Listening ...
4).客户端通过远程调试连接到远程主机的8888.

5)调试成功

网友评论