springredistemplate时不时就获取不到连接了

springredistemplate时不时就获取不到连接了,第1张

spring-data-redis 中的核心 *** 作类是 RedisTemplate 可以看出 key 和 value 都是泛型的,这就涉及到将类型进行序列化的问题了 所就在 RedisTemplate 中还有几个 RedisSerializer~ 1)redisConnectionFactory()配置了如何连接Redsi服务器

在阿里云Ubuntu新搭建的redis集群,始终无法连接,报Could not get a resource from the pool异常

查找资料发现是redist的一些限制,Protected mode is a layer of security protection, in order to avoid that

Redis instances left open on the internet are accessed and exploited 就是说出于安全考虑,redis的实例不能在网络上被访问,所以修改protected-mode就好了

所以将redisconf中的protected-mode yes改为protected-mode no

重启redis实例,以为问题就解决了?发现还是报Could not get a resource from the pool异常

这个是什么情况,要逆天嘛?

查看redis node信息看一下,终于发现了问题

怎么会有172的IP,到这里终于找到问题根源了,修改nodeconf配置,重启redis,问题终于解决。

以上就是关于springredistemplate时不时就获取不到连接了全部的内容,包括:springredistemplate时不时就获取不到连接了、连接远程的redis 集群报Could not get a resource from the pool异常、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/10134892.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-05
下一篇 2023-05-05

发表评论

登录后才能评论

评论列表(0条)

保存