Interesting remote debug code

    

    background:

      I haven't played with this thing before. Recently, I'm doing service splitting. Everyone is discussing whether the application without web interface started by tomcat can be switched to springBoot. A small partner in the middle proposed whether SpringBoot can continue to use the remote debugging function.

 

   Remote debug demo

       1. First of all, you have to specify the port of the remote debug application. Since we are using the omad platform, there is a debug port set, which will automatically restart the application after setting, which is very convenient.

 

       2. To establish a communication tunnel locally, you can use the command line, secureCrt or xshell. I use the command line directly, 12301 is the remote debug port set above, and 1046 is the ssh port.

ssh -L 12301:localhost:12301 -p 1046 hzzhaolong@remoteHostIP

       

       3. git sets the local code and remote code version all the time

           git reset --hard d2de28759e723588666ccfb2e36c03b36f393e98

 

       4. Set remote debug in idea

 
       
 

 

      Follow-up questions :

        1. How to set the remote port of java application in general?

        2. What is the principle of remote debugging?

 

 

 

 

          

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326112124&siteId=291194637