Merge pull request #139 from jy03078584/master

loadBlance ipHash
This commit is contained in:
CyC2018 2018-04-03 09:40:42 +08:00 committed by GitHub
commit edeee57a99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -127,6 +127,13 @@
<div align="center"> <img src="../pics//0ee0f61b-c782-441e-bf34-665650198ae0.jpg"/> </div><br>
### 6.源地址哈希法(ip hash)
源地址哈希通过对客户端IP哈希计算得到的一个数值用该数值对服务器数量进行取模运算取模结果便是目标服务器的序号。
- 优点保证同一IP的客户端都会被hash到同一台服务器上。
- 缺点不利于集群扩展后台服务器数量变更都会影响hash结果。可以采用一致性Hash改进。
<div align="center"> <img src="../pics//2018040301.jpg"/> </div><br>
## 实现
### 1. HTTP 重定向

BIN
pics/2018040301.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB