二狗子

Eureka

2020-07-07 · 1 min read

两个注解 @EnableEurekaClient @EnableEurekaServer

配置文件

eureka:
  client:
    service-url:
      defaultZone: http://localhost:8761/eureka/
    register-with-eureka: false
spring:
  application:
    name: eureka

高可用

多个eureka相互注册,1注册23,2注册13

eureka:
  client:
    service-url:
      defaultZone: http://localhost:8761/eureka/,http://localhost:8762/eureka/
    register-with-eureka: false
spring:
  application:
    name: eureka3

功能

  • 心跳检测
  • 健康检查
  • 负载均衡