nginx 配置一致性hash

来源:互联网 发布:第三方支付规模数据 编辑:程序博客网 时间:2024/05/16 04:59
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

7. 使用最新的配置文件./nginx -s reload


原创粉丝点击