eureka server启动后端口变为8080问题解决

错题集
背景:
application.yml配置如下,端口已经都改了,可是打包后每次启动8761端口就变成8080端口了。很坑,很坑。
spring:
application:
name: eureck-server

- - -
server:
port: 8761
spring:
profiles: peer1
eureka:
instance:
hostname: eureka_peer1
client:
serviceUrl:
defaultZone: http://localhost:8762/eureka/

- - -
server:
port: 8762
spring:
profiles: peer2
eureka:
instance:
hostname: eureka_peer2
client:
serviceUrl:
defaultZone: http://localhost:8761/eureka/

解决:
配置文件中加 nonSecurePort: ${server.port} 属性即可,
eureka server启动后端口变为8080问题解决_第1张图片

你可能感兴趣的:(SpringCloud,eureka)