Eureka配置

客户端:

eureka.instance.prefer-ip-address = true

eureka.instance.instance-id=${spring.application.name}:${spring.cloud.client.ipAddress}:${server.port}
eureka.client.service-url.defaultZone = http://localhost:8761/eureka
eureka.instance.metadata-map.management.context-path = ${server.servlet.context-path}/actuator
eureka.instance.metadata-map.prometheus.scrape=true
eureka.instance.metadata-map.prometheus.path=${server.servlet.context-path}/actuator/prometheus
eureka.instance.metadata-map.prometheus.application=${spring.application.name}
eureka.instance.metadata-map.prometheus.env=DEV
eureka.instance.metadata-map.prometheus.project=Orange

如果客户端之前要使用hostname来进行通信:

eureka.instance.hostname=${APPLICATION_NAME}

eureka.instance.prefer-ip-address = false

服务端:

eureka:
  instance: 
    prefer-ip-address: true 
    met

你可能感兴趣的:(Java从开发到设计,eureka,云原生)