Spring Boot: 1.5.10.RELEASE
Spring Cloud: Dalston.SR5
什么是 Eureka
在 Netflix/eureka 的GitHub Wiki 中有如下描述:
Eureka is a REST (Representational State Transfer) based service that is primarily used in the AWS cloud for locating services for the purpose of load balancing and failover of middle-tier servers. We call this service, the Eureka Server. Eureka also comes with a Java-based client component,the Eureka Client, which makes interactions with the service much easier. The client also has a built-in load balancer that does basic round-robin load balancing. At Netflix, a much more sophisticated load balancer wraps Eureka to provide weighted load balancing based on several factors like traffic, resource usage, error conditions etc to provide superior resiliency.
Eureka 是一个基于 REST 的服务,用于定位服务,以实现云端中间层服务发现和故障转移。
Spring Cloud 封装了 Netflix 的 Eureka 模块来实现服务注册和发现。
Eureka 服务端 VS Eureka 客户端
Eureka 采用了 C-S 的设计架构。
Eureka Server 作为服务注册功能的服务端,充当服务注册中心。
Eureka Client 作为服务注册功能的客户端,将向服务端注册自身,并以心跳连接服务端。
Eureka Client 将本地缓存服务列表。
Eureka 架构
Eureka 架构图如下: