负载均衡 ip_hash 与一致性哈希算法

负载均衡 ip_hash

ip_hash 可以保证用户访问可以请求到上游服务中的固定的服务器,前提是用户ip没有发生更改。

使用ip_hash的注意点:

不能把后台服务器直接移除,只能标记 down .否则会导致hash算法更改,会话和缓存也都失效了。

If one of the servers needs to be temporarily removed, it should be marked with the down parameter in order to preserve the current hashing of client IP add

upstream tomcats {

ip_hash;

server 192.168.1.173:8080;

server 192.168.1.174:8080 down;

server 192.168.1.175:8080;

}

负载均衡 ip_hash 与一致性哈希算法

负载均衡 ip_hash 与一致性哈希算法

负载均衡 ip_hash 与一致性哈希算法

© 版权声明

相关文章

暂无评论

none
暂无评论...