Multi-instance is a service that deploys multiple applications with the same function. As we all know, one instance needs to occupy one port, and the configuration file in our code can only specify one port.
- Question: How to specify the port number it occupies when starting the microservice?
1. Right-click on the microservice to be copied and select Copy Configuration
2. Right-click on the copied configuration to edit
3. Set the name and port number of the new microservice ( specify the port to start on the VM parameter side:- Dserver.port=xxxx)
-Dserver.port=63051 -Dxxl.job.executor.port=9998
4. After everything is started, you can clearly see that a service has been deployed by multiple instances in the nacos registration center