eureka用ip地址注册

  sre

配置文件:

eureka:
  client:
    service-url:
      defaultZone: http://test-registry:8761/eureka/
  instance:
    preferIpAddress: true
    ## 将Instance ID设置成IP:端口的形式
    instance-id: {spring.cloud.client.ip-address}:{server.port}     

或者启动时指定:

java -jar test.jar --eureka.instance.preferIpAddress=true --eureka.instance.instance-id={spring.cloud.client.ip-address}:{server.port}

LEAVE A COMMENT

Captcha Code