Ribbon内置了多种负载均衡策略,内部负责负载均衡的顶级接口为com.netflix.loadbalanced.IRule
服务消费者,application.yml中添加
#修改ribbon的负载均衡策略 服务名 - ribbon - NFLoadBalancerRuleClassName : 策略
service-product:
ribbon:
NFLoadBalancerRuleClassName: com.netflix.loadbalancer.RandomRule
此时会将负载均衡策略修改为随机策略.
标签:负载,策略,netflix,springcloud,ribbon,均衡,NFLoadBalancerRuleClassName From: https://blog.51cto.com/u_12528551/5900123