0

I have Eureka server, Eureka zuul and config server. So I write a simple microservice. Then, running on 8686 port.

So I want to run that microservice on another port. I trying that command. But don't work.

java -Dserver.port=8687 -jar -Dlogging.file="bla.log" testMicro.jar --debug > "bla.log"&

I am confusing. Help me!

Nyamkhuu Buyanjargal
  • 621
  • 2
  • 11
  • 29
  • You want to run your tomcat on 8687 and eureka on 8686 but both are running on 8686. Is that what is happening ? – IllegalSkillsException Apr 24 '19 at 04:42
  • I want to test my load balance/Zuul/ so I should run two more than instances. I can't start new instance on another port. Because that instance get application yaml file from config server. So Dserver command don't work. :( – Nyamkhuu Buyanjargal Apr 24 '19 at 05:39

1 Answers1

1

You have two ways to running your instances on different ports.

  1. user assignment of random port from a specified range:
server:
  port: ${random.int(8080,8090)}
  1. Set in property file from config server for testMicro microservice the following configurations:
spring:
  cloud:
    config:
      override-system-properties: false
      allow-override: true
      override-none: true

and then run again your jar with -Dserver.port=8687 property

Vladlen Gladis
  • 1,699
  • 5
  • 19
  • 41