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
更多推荐
已为社区贡献3条内容
所有评论(0)