Laravel Error while reading line from the server解决方案
最近加了一台服务器,使用两台服务器部署nginx的负载均衡,但是运行了一段时间后,Redis报错:Error while reading line from the server。解决方案:修改 config/database.php 文件,找到 redis 的配置项,加上 read_write_timeout 参数,设置为 0来禁用 Redis 的默认超时。'redis' => ['clu
·
最近加了一台服务器,使用两台服务器部署nginx的负载均衡,但是运行了一段时间后,Redis报错:Error while reading line from the server。
解决方案:
- 修改
config/database.php文件,找到redis的配置项,加上read_write_timeout参数,设置为0来禁用 Redis 的默认超时。
'redis' => [
'cluster' => false,
'default' => [
'host' => env('REDIS_HOST', 'localhost'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => 0,
'read_write_timeout' => 0
],
],
- 如果第一种方案行不通的话,而此时你的项目只有某台
redis出现Error while reading line from the server的问题时,你可能需要检查一下该redis的配置,设置timeout为较大的数值或者关闭(不推荐关闭)
timeout=10
更多推荐



所有评论(0)