主机名称:服务名称修改
当前问题
我希望显示的localhost:cloud-payment-server:8091
是自己定义的主机名称
修改pom
eureka:
client:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://eureka7002.com:7002/eureka,http://eureka7001.com:7001/eureka/ #集群版
#defaultZone: http://eureka7001.com:7001/eureka/
# 加上
instance:
instance-id: payment8090
修改配置后显示的主机名称
访问信息有ip信息提示
改配置文件yml
eureka:
client:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://eureka7002.com:7002/eureka,http://eureka7001.com:7001/eureka/ #集群版
#defaultZone: http://eureka7001.com:7001/eureka/
instance:
instance-id: payment8091
prefer-ip-address: true #访问路径可以显示ip地址