设为首页 - 加入收藏  
您的当前位置:首页 >应用开发 >redis中Could not get a resource from the pool异常及解决方案 正文

redis中Could not get a resource from the pool异常及解决方案

来源:亿华互联编辑:应用开发时间:2025-11-05 15:50:12

描述

这个错误产生的常及前提是这样的,将数据存入redis(新安装的解决)中,在通过连接池获取jedis实例时,常及产生如下错误( Could not get a resource from the pool)。解决

分析

由于是站群服务器常及新安装的redis,配置文件没有更改,解决低级的常及错误浪费不少时间,写一篇文章,解决让同样犯这种错误的常及朋友别再浪费时间。亿华云计算

解决

更改配置文件 redis.conf 中两处

1.将 bind 127.0.0.1 注释掉

2.将 protected-mode 改为 no

bind 127.0.0.1 protected-mode 默认情况bind=127.0.0.1只能接受本机的解决访问请求不写的情况下,无限制接受任何ip地址的常及访问 如果开启了protected-mode,那么在没有设定bind ip且没有设密码的解决情况下,Redis只允许接受本机的高防服务器常及相应

运行代码

?
最新文章

2.5125s , 11637.953125 kb

Copyright © 2025 Powered by redis中Could not get a resource from the pool异常及解决方案,亿华互联  滇ICP备2023000592号-16

sitemap

Top