Merge pull request #141 from jy03078584/master

fix
This commit is contained in:
CyC2018 2018-04-03 10:10:39 +08:00 committed by GitHub
commit 3e35079cf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View File

@ -127,6 +127,15 @@
<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//2018040302.jpg"/> </div><br>
## 实现
### 1. HTTP 重定向

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

BIN
pics/2018040302.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB