为了在线远程调试线上bug(特殊情景需要),可以在JAVA 项目启动参数配置如下
nohup java -Xmx1024m -XX:+UseParallelGC -Xms512m -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=19999 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false /data/saas_platform/service-1.0-SNAPSHOT.jar --spring.profiles.active=production --log.level=debug > saas_platform_service.log 2>&1 &
在IDEA 执行远程调试
远程调试连上会显示如下信息
在本地 IDEA设置断点,访问远程项目路径 ,可以看到断点监听到远程代码了