Blogger Information
Blog 16
fans 0
comment 0
visits 14697
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
第三方模块编译及一致性hash
进击的小菜鸟
Original
815 people have browsed it

nginx需要安装ngx_http_consistent_hash模块


nginx配置

在upstream中添加   consistent_hash  $request_uri;(相比于负载均衡加了这一行就会实现一致性)


在php.ini中配置

memcache.hash_strategy=consistent

php代码中添加memcache服务

$mem=new memcache();

$mem->addServer('127.0.0.1',11211);//注意upstream做负载均衡不能使用localhost 需要用ip或远程主机名

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post