Could not get a resource from the pool 异常定位和解决
最近在服务中经常看到以下错误,进行下定位和问题解决分析:
2023-12-08 00:10:58.248 WARN [terra-sr-server,a9006fd27ccb81d0,a9006fd27ccb81d0,false] 52 --- [o-14009-exec-38] o.s.b.a.redis.RedisHealthIndicator : Redis health check failed org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool

这个异常 org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool 表示应用程序无法从连接池中获取一个 Redis 连接。这可能是因为连接池已经耗尽,或者 Redis 服务器无法接受更多的连接。
解决这个问题的方法是首先确定 Redis 服务器的状态,然后检查应用程序的 Redis 连接配置。
1.登录redis,并查看最大连接数:
redis-cli -h 127.0.0.1 -p 6379
config get maxclients

2.info 查询redis信息:
info

3.服务器端服务器执行以下命令,查看连接数
netstat -nat |awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -nr|head -20

注:忽略上图的数据,截图时问题已经修复,截图只是为了查看命令返回的数据和格式
4.最终解决结果
在项目中配置的redis最大连接数是100,调整了项目中reids的最大连接数之后 异常便得以解决。
Could not get a resource from the pool 异常定位和解决的更多相关文章
- 记redis一次Could not get a resource from the pool 异常的解决过程
最近有个项目中的redis每天都会报 "Could not get a resource from the pool"的错误,而这套代码在另一地方部署又没有问题.一直找不到错误原因 ...
- redis中 Could not get a resource from the pool 异常解决
https://blog.csdn.net/qh_java/article/details/54669973
- Redis一个异常的解决办法,异常描述:Could not get a resource from the pool
异常描述: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the poo ...
- redis提示Could not get a resource from the pool(jedis连接池配置)
起初在JedisPool中配置了50个活动连接,但是程序还是经常报错:Could not get a resource from the pool 连接池刚开始是这样配置的: JedisPoolCon ...
- redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
超时 Exception in thread "main" redis.clients.jedis.exceptions.JedisConnectionException: jav ...
- redis性能调优笔记(can not get Resource from jedis pool和jedis connect time out)
对这段时间redis性能调优做一个记录. 1.单进程单线程 redis是单进程单线程实现的,如果你没有特殊的配置,redis内部默认是FIFO排队,即你对redis的访问都是要在redis进行排队,先 ...
- redis客户端可以连接集群,但JedisCluster连接redis集群一直报Could not get a resource from the pool
一,问题描述: (如题目)通过jedis连接redis单机成功,使用JedisCluster连接redis集群一直报Could not get a resource from the pool 但是使 ...
- spring整合redis使用RedisTemplate的坑Could not get a resource from the pool
一.背景 项目中使用spring框架整合redis,使用框架封装的RedisTemplate来实现数据的增删改查,项目上线后,我发现运行一段时间后,会出现异常Could not get a resou ...
- Could not get a resource from the pool 错误解决
错误关键信息:Could not get a resource from the pool 通常原因是因为远程服务器上的redis没有配置好. 解决方案如下:(1)将redis.conf中的bind: ...
- [报错]Could not get a resource from the pool
redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool解决:开启 ...
随机推荐
- 9 "网址"--URI
目录 URI和URL URI详细介绍 URI的组成 URI的查询参数 URI的编码 疑问 URI和URL URI:统一资源标识符(Uniform Resource Identifier) 有两种形式: ...
- 【论文阅读】HTTP 流量和恶意 URL 的异常检测
Part 1关于论文 基本信息 题目:HTTP 流量和恶意 URL 的异常检测 源码:sec2vec源代码 摘要 在本文中,我们将展示如何利用自然语言处理(NLP)中已知 的方法来检测 HTTP 请求 ...
- All in One, 快速搭建端到端可观测体系
本文分享自华为云社区<All in One, 快速搭建端到端可观测体系>,作者:王磊. 随着云原生技术的应用,可观测成为云服务的主角,应用程序的部署密度及变化频率较传统环境有着巨大的变化, ...
- python tkinter使用(五)
python tkinter使用(五) 本篇文章讲述tkinter 中treeview的使用 Treeview是一个多列列表框,可以显示层次数据. #!/usr/bin/python3 # -*- c ...
- 【UniApp】-uni-app-打包成小程序
前言 大家好,我是 BNTang, 在上一节文章中,我给大家详细的介绍了如何将我开发好的项目打包为网页. 趁热打铁,在来一篇文章,给大家详细的介绍如何将项目打包为小程序. 正文 打开微信小程序呢,其实 ...
- 开源易课堂操作手册-yiketang
title: 开源易课堂操作手册 date: 2022-01-05 15:10:43.915 updated: 2023-04-24 10:21:28.476 url: https://www.yby ...
- 微软成为PostgreSQL主要贡献者
微软成为PostgreSQL主要贡献者 微软对PostgreSQL贡献的很多新功能都来自于客户在使用微软Azure上的PostgreSQL管理实例数据库,所以这些新功能都来自于真实的客户需求 微软对P ...
- Windows Server2016 默认使用英文输入法或默认使用中文输入法
1.确认是Server2016操作系统及以后版本 2.打开开始菜单"设置"--"时间和语言" 3.添加英文输入法(已存在可以跳过) 找到"区域与语言& ...
- STM32CubeMX教程6 TIM 通用定时器 - 生成PWM波
1.准备材料 开发板(STM32F407G-DISC1) ST-LINK/V2驱动 STM32CubeMX软件(Version 6.10.0) keil µVision5 IDE(MDK-Arm) 逻 ...
- Github 星标 8K+ 这款国人开源的 Redis 可视化管理工具,真香...
做程序员就少不了与一些工具打交道,比如:监控工具.管理工具等,有些工具是命令行界面,有些工具是可视化界面,反正都是可以能够满足日常使用的功能需求. 对于redis管理工具来说,也有不少可能的产品,比如 ...