Kong Dashboard系列【二】kong负载均衡配置

写在前边

提供可被调用的接口
本例中通过Java提供简单接口,见源码,通过不同配置文件启动,通过9000和9001端口都能访问。
Kong Dashboard系列【二】kong负载均衡配置
Kong Dashboard系列【二】kong负载均衡配置
Kong Dashboard系列【二】kong负载均衡配置
Kong Dashboard系列【二】kong负载均衡配置

kong dashboard添加upstreams

Kong Dashboard系列【二】kong负载均衡配置

upstreams添加targets

Kong Dashboard系列【二】kong负载均衡配置
Kong Dashboard系列【二】kong负载均衡配置
Kong Dashboard系列【二】kong负载均衡配置

为service添加upstreams

service的host为upstreams的name值
Kong Dashboard系列【二】kong负载均衡配置

给service添加routes

Kong Dashboard系列【二】kong负载均衡配置

验证负载均衡

Kong Dashboard系列【二】kong负载均衡配置
kong网关的负载均衡并不像nginx那样严格的按照wergit的比例进行访问,但是总的来说也是能够看出访问到9000和9001 的次数成weight的比例。