发布于 2015-08-09 08:48:59 | 1322 次阅读 | 评论: 0 | 来源: 网络整理

修改 apps/configs/redis.php ,加入配置。

$redis['master'] = array(
    'host' => '172.19.104.157',
    'port' => 6379, //默认为6379
    //'database' => 16, //数据库ID,可选
);
  • 默认取master项作为redis配置,$this->redis->get,框架会读取$this->config['redis']['master']作为配置
  • 使用$this->redis('master2')->get 实现多实例访问,框架会读取$this->config['redis']['master2']作为配置
最新网友评论  共有(0)条评论 发布评论 返回顶部

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务