Could not get a resource from the pool 错误解决

当遇到'Couldnotgetaresourcefromthepool'错误时,可能的原因包括Linux防火墙未关闭、Redis配置文件未正确修改或SpringBoot应用的连接超时设置过小。关闭防火墙可以通过'systemctlstopfirewalld.service'命令实现,修改redis.conf文件需取消bind的限制并禁用protected-mode,同时检查SpringBoot的timeout配置,确保连接延迟适当。

Could not get a resource from the pool 错误解决

错误信息:Could not get a resource from the pool
可能造成错误原因:

1 没关闭Linux防火墙

查看防火墙状态

systemctl status firewalld.service

Active: active(running),说明防火墙是开启状态
关闭防火墙命令

systemctl stop firewalld.service

Active: inactive (dead),说明防火墙关闭

2 没有修改redis.conf文件

对redis.conf文件内容进行修改
(1)将redis.conf中的bind:127.0.0.1注释掉
(2)将redis.conf中的protected-mode yes改为protected-mode no
然后杀死原有redis进程并重新开启redis服务

ps -ef|grep redis
kill -9 进程号

3 SpringBoot中application.properties内容问题

连接延迟不要设置太小

spring.redis.timeout=18000000
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值