redis 连接报错 GET_LIKE_ERROR 处理过程
来源:互联网 发布:淘宝退货物流信息填错 编辑:程序博客网 时间:2024/05/29 04:42
1,redis报警
运营同事说app登录不了,运维工程师说卡在redis这里,然后去后台看了app工程日志,有如下报警信息:
2016-06-06 16:26:03,838 [http-6600-2:ERROR] com.plocc.ugc.redis.service.impl.RedisServiceImpl - GET_LIKE_ERROR
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
at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:97)
at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:143)
at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:41)
at org.springframework.data.redis.core.RedisConnectionUtils.doGetConnection(RedisConnectionUtils.java:128)
at org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:91)
at org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:78)
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:177)
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:152)
at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:84)
at org.springframework.data.redis.core.DefaultHashOperations.get(DefaultHashOperations.java:44)
at com.plocc.ugc.dao.impl.UgcRedisDaoImpl.getIsLike(UgcRedisDaoImpl.java:77)
at com.plocc.ugc.redis.service.impl.RedisServiceImpl.getIsFave(RedisServiceImpl.java:126)
at com.plocc.ugc.service.impl.RecommendationH5ServiceImpl.queryRecommendationList(RecommendationH5ServiceImpl.java:119)
at sun.reflect.GeneratedMethodAccessor71.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(RemoteInvocationTraceInterceptor.java:77)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at com.sun.proxy.$Proxy188.queryRecommendationList(Unknown Source)
at sun.reflect.GeneratedMethodAccessor71.invoke(Unknown Source)
2,在应用服务器上连接下当前连接的redis
在应用服务器上telnet端口,发现close了:
[tomcat@azure_ipower_app_3_29 logs]$ telnet192.168.3.40 6379
Trying 192.168.3.40...
Connected to 192.168.3.40.
Escape character is '^]'.
-ERR max number of clients reached
Connection closed by foreign host.
[tomcat@azure_ipower_app_3_29 logs]$
3,去redis服务器查看redis服务
但是在redis服务器上,redis是起着的:
[root@azure_ipower_cache1_3_40 ~]# ps-eaf|grep redis
root 43660 1 7 16:54 ? 00:02:06/usr/local/redis/bin/redis-server 127.0.0.1:6379
root 43874 43409 0 17:24 pts/2 00:00:00 grep redis
[root@azure_ipower_cache1_3_40 ~]#
4,问题分析解决
重启了应用tomcat服务器以及重启了redis服务器还是一样的报错信息,后来想到了,最近做了redis服务器迁移,可能是旧的redis服务器的配置引起的,然后尝试停止了旧的redis的服务器,去掉修改了/etc/hosts里面的kafka、zookpeer指定:
注释掉kafka、zookpeer的映射:
vim /etc/hosts
#10.250.1.11 k1
#10.250.1.21 k2
#10.250.1.22 k3
# (这里使用redis是经过了zookpeer、kafka的转发的,所以对/etc/hosts里面配置的ip和别名的映射)。
然后在应用服务器上,telnetredis 端口,ok,可以用了:
[tomcat@azure_ipower_app_3_29ugc_service]$ telnet 192.168.3.40 6379
Trying 192.168.3.40...
Connected to 192.168.3.40.
Escape character is '^]'.
然后再启动应用服务器就ok了,应用能正常对redis进行操作了,公司业务系统也可以正常运转了。
网上搜索看到别人经历过的出错原因有:
(1) linux防火墙iptables没有关闭
(2) redis假死重启redis
(3) 连接的redis是从库不是主库导致
- redis 连接报错 GET_LIKE_ERROR 处理过程
- redis 连接报错
- 远程连接redis报错
- Redis_Java连接Redis报错
- java连接Redis报错
- linux系统中pl/sql连接oracle报错,报错ora28000处理过程
- 连接redis,报错Permission denied
- jedis连接不上redis,sentinel报错
- java连接vm中redis报错 Connection refused: connect
- Java连接虚拟机的redis报错问题解决办法
- Java连接linux虚拟机的redis报错问题解决办法
- Jedis 连接 Redis 客户端 报错 Connection Refused
- Java连接虚拟机的redis报错问题解决办法
- Java连接虚拟机的redis报错问题解决办法
- Java连接虚拟机的redis报错问题解决办法
- 处理应用端连接redis报could not get a resource from the pool问题
- 应用连接redis报max number of clients reached问题的处理
- Redis:使用jedis连接redis数据库过程
- hadoop基础----hadoop实战(一)-----hadoop环境安装---手动安装官方1.0版本
- NI面经
- python之函数基础篇
- sublime2打开其他文件中文乱码问题--亲测有效
- 第十三周上机实践项目:阅读、修改和运行关于交通工具类的程序(1)
- redis 连接报错 GET_LIKE_ERROR 处理过程
- Java模块 -- 读取Excel文件写入数据库 Mybatis , POI , JXL
- 二叉树遍历非递归算法
- Android小程序——乐学成语实现(三)
- RxJava实现view的双击事件
- USACO5.5 降维扫描/离散_最小表示法_记忆化搜索
- Android打造万能适配器(一)再谈传统适配器
- ajaxfileupload IE10 拒绝访问
- eclipse中的tomcat,代码中创建file获取目录与tomcat单独运行获取目录不同的解决办法