【发布时间】:2018-11-02 04:40:09
【问题描述】:
Zuul 和 Ribbon 都可以用于负载均衡。但是在哪种情况下我们应该更喜欢 Zuul 而不是 Ribbon,反之亦然?
【问题讨论】:
标签: spring-boot microservices netflix-zuul netflix-ribbon
Zuul 和 Ribbon 都可以用于负载均衡。但是在哪种情况下我们应该更喜欢 Zuul 而不是 Ribbon,反之亦然?
【问题讨论】:
标签: spring-boot microservices netflix-zuul netflix-ribbon
默认 Zuul 负载均衡器使用来自 Ribbon 的 ZoneAwareLoadBalancer。因此,没有什么比在 Zuul 和 Ribbon 之间进行负载平衡更好的选择了,基本上是 Ribbon 参与了负载平衡。查看Zuul load-balancing
由于 Ribbon 是一个客户端负载平衡器模块,并且集成到许多 http 客户端模块中。例如,Feign 和负载均衡的 RestTemplate 支持 Ribbon。检查Ribbon's working with load balancer
关于 Zuul,有一个 RibbonRoutingFilter 将您的请求路由到实际的服务实例。 RibbonRoutingFilter 正在使用 Ribbon 从您的配置或 Eureka 提供的列表中选择一个服务器。 所以如果你想使用 Zuul 作为负载均衡的反向代理,Zuul 需要 Ribbon。
【讨论】: