当前位置: 代码迷 >> 综合 >> Uncaughtnbsp;exceptionnbsp;#039;Re
  详细解决方案

Uncaughtnbsp;exceptionnbsp;#039;Re

热度:52   发布时间:2024-01-18 11:28:30.0
原文地址:Uncaught exception 'RedisException' with message 'read&n 作者:congcongbebe
最近把项目的redis缓存改成代理的方法,但是修改后一直报  Fatal error: Uncaught exception 'RedisException' with message 'read error on connection' in XXX的错误

试了一些网上的方法,修改php.ini文件 ini_set('default_socket_timeout', -1);   //不超时,升级redis版本,ping代理服务,各种方法都试了也是不行。

最后看了下一位播客仁兄的redis的配置说明

listen: 127.0.0.1:6379 #使用哪个端口启动Twemproxy  
redis: true #是否是Redis的proxy  
hash: fnv1a_64 #指定具体的hash函数  
distribution: ketama #具体的hash算法  
auto_eject_hosts: true #是否在结点无法响应的时候临时摘除结点  
timeout: 400 #超时时间(毫秒)  
server_retry_timeout: 2000 #重试的时间(毫秒)  
server_failure_limit: 1 #结点故障多少次就算摘除掉  
servers: #下面表示所有的Redis节点(IP:端口号:权重)  
  - 127.0.0.1:6380:1  
  - 127.0.0.1:6381:1  
  - 127.0.0.1:6382:1 
再对比了下自己的。发现 redis: true这个配置没加上。。。坑啊。。。。
  相关解决方案