作者寄语:
看到很多人在问redis的主从分布式如何进行扩展,给大家写一个,感谢支持,有任何疑问和优化建议,请发邮件:dreamernn@163.com,并且说一句,我叫大象猴猴 欢迎王者农药来战 哈哈~
下载附件,直接上传到 \thinkphp\library\think\cache\driver 下
配置文件如下
'redisd' => [
'type' => 'redisd', // 驱动方式
'host' => '172.16.30.167,172.16.30.167', // 服务器地址 ip地址一样也需要重复写
'port' => '6379,6380'
],
调用方式:
$res = Cache::store('redisd')->set('m1');
$res = Cache::store('redisd')->get('m1');