nginx 配置一致性hash
1. https://github.com/sduwangning/ngx_http_consistent_hash
2. 配置源码信息 cd /path/to/nginx 执行./configure --add-module=/tmp/nginx_upstream_hash-0.3
3. make
4 make install
5 配置nginx.conf
upstream upload {
consistent_hash $request_uri; # consistent_hash $remote_addr
server 10.11.19.15:8087;
server 10.11.19.15:8080;
}
6. 测试配置是否正确 nginx -t
1. https://github.com/sduwangning/ngx_http_consistent_hash
2. 配置源码信息 cd /path/to/nginx 执行./configure --add-module=/tmp/nginx_upstream_hash-0.3
3. make
4 make install
5 配置nginx.conf
upstream upload {
consistent_hash $request_uri; # consistent_hash $remote_addr
server 10.11.19.15:8087;
server 10.11.19.15:8080;
}
6. 测试配置是否正确 nginx -t
7. 使用最新的配置文件./nginx -s reload