How to start two instances of the same time in different ports in IntelliJ Idea

 Tools need to enable the different ports in a project in SpringCloud development process, I am using IDEA

 Step 1 Create SpringBoot project

 

 Step 2 Add the configuration file as follows:

      spring.application.instance_id=instance-${server.port}

 

 Step 3 Start Edit Configurations check Allow parallel run in the dialog box that opens in the top right corner of IDEA, an increase -Dserver.port = 8011 and click Apply in the VM Options

 

  Step 4 followed by the second one, the upper left corner there is a copy button, when clicked only need to modify the port and the names do not need to check the Allow parallel run and then very happy to start up!

 

 

Guess you like

Origin www.cnblogs.com/yang-xiansen/p/11484261.html