作者:湖南美景创意动画设计有限公司 | 来源:互联网 | 2018-04-22 20:20
php代码
6379),
array('host'=>'192.168.1.3', 'port'=>6379),
array('host'=>'192.168.1.4', 'port'=>6379),
array('host'=>'192.168.1.5', 'port'=>6379),
);
$key = 'username';
$value = 'lane';
//根据KEY获取hash
$hash = $this->test($key);
$count = count($mamcacheList);
$mamcache = $mamcacheList[$hash % $count];
$mc = new Mamcached($mamcache);
$mc->set($key, $value);
?>