当前位置:网站首页>记一次redis超时
记一次redis超时
2022-07-01 09:00:00 【南风知我意丿】
项目场景:
Spark Streaming任务消费kafka,把offsets存到redis
问题描述
主要bug:
ERROR yarn.ApplicationMaster: User class threw exception: redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out
redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: Read timed out
at redis.clients.jedis.util.RedisInputStream.ensureFill(RedisInputStream.java:204)
at redis.clients.jedis.util.RedisInputStream.readByte(RedisInputStream.java:42)
at redis.clients.jedis.Protocol.process(Protocol.java:126)
at redis.clients.jedis.Protocol.read(Protocol.java:192)
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:316)
at redis.clients.jedis.Connection.getOne(Connection.java:298)
at redis.clients.jedis.Connection.executeCommand(Connection.java:123)
at redis.clients.jedis.Jedis.set(Jedis.java:4725)
at cn.huorong.utils.RedisUtils$.$anonfun$writeOffset$3(RedisUtils.scala:45)
at scala.collection.immutable.Map$Map1.foreach(Map.scala:128)
at cn.huorong.utils.RedisUtils$.writeOffset(RedisUtils.scala:40)
at cn.huorong.run.SampleTaskSinkHbaseMapping.$anonfun$sink$1(SampleTaskSinkHbaseMapping.scala:51)
at cn.huorong.run.SampleTaskSinkHbaseMapping.$anonfun$sink$1$adapted(SampleTaskSinkHbaseMapping.scala:17)
at org.apache.spark.streaming.dstream.DStream.$anonfun$foreachRDD$2(DStream.scala:629)
at org.apache.spark.streaming.dstream.DStream.$anonfun$foreachRDD$2$adapted(DStream.scala:629)
at org.apache.spark.streaming.dstream.ForEachDStream.$anonfun$generateJob$2(ForEachDStream.scala:51)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
at org.apache.spark.streaming.dstream.DStream.createRDDWithLocalProperties(DStream.scala:417)
at org.apache.spark.streaming.dstream.ForEachDStream.$anonfun$generateJob$1(ForEachDStream.scala:51)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
at scala.util.Try$.apply(Try.scala:213)
at org.apache.spark.streaming.scheduler.Job.run(Job.scala:39)
at org.apache.spark.streaming.scheduler.JobScheduler$JobHandler.$anonfun$run$1(JobScheduler.scala:256)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
at org.apache.spark.streaming.scheduler.JobScheduler$JobHandler.run(JobScheduler.scala:256)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.SocketTimeoutException: Read timed out
原因分析:
redis集群 负载过大导致 redis连接超时,程序挂掉
解决方案:
增加redis时间即可
//connectionTimeout 连接超时(默认2000ms)
private val redis: Jedis = new Jedis(HOST, PORT,100000)
边栏推荐
- Insert mathematical formula in MD document and mathematical formula in typora
- Redis -- lattice connects to redis cluster
- 嵌入式工程师常见面试题2-MCU_STM32
- Vsync+ triple cache mechanism +choreographer
- Centos7 shell script one click installation of JDK, Mongo, Kafka, FTP, PostgreSQL, PostGIS, pgrouting
- Mysql8.0 learning record 17 -create table
- 钓鱼识别app
- Yolov3, 4, 5 and 6 Summary of target detection
- yolov5训练可视化指标的含义
- pcl_viewer命令
猜你喜欢

How can enterprises and developers take the lead in the outbreak of cloud native landing?

1.jetson与摄像头的对接

Guidelines and principles of did

What are the differences between the architecture a, R and m of arm V7, and in which fields are they applied?

Personal decoration notes

What is the material of 16mo3 steel plate? What is the difference between 16mo3 and Q345R?

Understanding and implementation of AVL tree

Jeecg restart alarm 40001

19Mn6 German standard pressure vessel steel plate 19Mn6 Wugang fixed binding 19Mn6 chemical composition

【MFC开发(17)】高级列表控件List Control
随机推荐
How to solve the problem of fixed assets management and inventory?
动态代理
中小企业固定资产管理办法哪种好?
Vsync+ triple cache mechanism +choreographer
用C语言编程:用公式计算:e≈1+1/1!+1/2! …+1/n!,精度为10-6
jeecg 重启报40001
Understanding and implementation of AVL tree
Redis源码学习(29),压缩列表学习,ziplist.c(二)
Shell脚本-while循环详解
Shell脚本-位置参数(命令行参数)
NiO zero copy
Pain points and solutions of fixed assets management of group companies
钓鱼识别app
Yolov3, 4, 5 and 6 Summary of target detection
中断与其他函数共享变量、临界资源的保护
C language student information management system
Shell script -read command: read data entered from the keyboard
Shell script echo command escape character
IT 技术电子书 收藏
Promise异步编程