在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