eureka自定义instance Id

在Eureka注册中心中查看发现其Eureka client注册信息,在集群中为了更好的区分eureka client服务,可以,需要进行自定义instance Id

 在配置文件中eurkea.instance.instance-id=${spring.application.name}:${eureka.instance.prefer-ip-address}:${server.port}

在点击服务的instance Id跳转,跳转到指定的链接,链接未配置的情况下为 主机名 的方式

跳转时如果链接地址要显示ip 需要将 eureka.instance.prefer-ip-address的值为true

默认情况下,该服务跳转的为  IP+Port/info

可通过配置修改,相对地址和绝对地址两种方式,如果两种都存在的情况下,绝对地址的优先级要高于相对地址

 1 eureka:
 2   client:
 3     service-url:
 4       defaultZone: http://localhost:8761/eureka
 5   instance:
 6     prefer-ip-address: true
 7     instance-id: ${spring.application.name}:${eureka.instance.prefer-ip-address}:${server.port}
 8 #绝对路径
 9     status-page-url: http://www.baidu.com
10  #相对路径
11     status-page-url-path: /user/hello
生于忧患,死于安乐
原文地址:https://www.cnblogs.com/songlove/p/14804791.html