Skip to content

负载均衡

Haotian Zhang edited this page Dec 16, 2024 · 5 revisions

目录

简介

北极星默认提供了一些负载均衡能力Spring Cloud Tencent 为简化开发者使用,统一注入默认的负载均衡器,以便支持基于配置指定默认的负载均衡算法。

调整负载均衡策略

配置方式设置

Spring Cloud Tencent 提供了另外一种通过配置(spring.cloud.polaris.loadbalancer.strategy)的方式来达到调整负载均衡策略的方式。可设置的值为:

负载均衡策略
roundRobin 轮询算法。
random 随机算法
polarisWeightedRandom 北极星权重随机算法,通过北极星页面调整权重生效的前提是负载均衡算法是 polarisWeightedRandom
polarisRingHash 北极星一致性哈希算法
polarisWeightedRoundRobin **默认负载均衡策略。**北极星权重轮询算法。算法实现:https://github.com/polarismesh/polaris-java/pull/413
Clone this wiki locally