当前位置:网站首页>记一次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)
边栏推荐
- What is the material of 16mo3 steel plate? What is the difference between 16mo3 and Q345R?
- Shell脚本-case in 和正则表达式
- In depth learning training sample amplification and tag name modification
- Shell script -if else statement
- AVL树的理解和实现
- 个人装修笔记
- Understand shallow replication and deep replication through code examples
- Vsync+ triple cache mechanism +choreographer
- Embedded Engineer Interview Question 3 Hardware
- Flink interview questions
猜你喜欢

MySQL optimization

3. Detailed explanation of Modbus communication protocol

Guidelines and principles of did

Bimianhongfu queren()

Centos7 shell script one click installation of JDK, Mongo, Kafka, FTP, PostgreSQL, PostGIS, pgrouting

C语言指针的进阶(下)

Football and basketball game score live broadcast platform source code /app development and construction project

Understanding and implementation of AVL tree

MD文档中插入数学公式,Typora中插入数学公式

Introduction to 18mnmo4-5 steel plate executive standard and delivery status of 18mnmo4-5 steel plate, European standard steel plate 18mnmo4-5 fixed rolling
随机推荐
1. Connection between Jetson and camera
Understand shallow replication and deep replication through code examples
Redis源码学习(29),压缩列表学习,ziplist.c(二)
Daily office consumables management solution
Bimianhongfu queren()
中断与其他函数共享变量、临界资源的保护
嵌入式工程师常见面试题2-MCU_STM32
[MFC development (17)] advanced list control list control
Shell脚本-特殊变量:Shell $#、$*、[email protected]、$?、$$
Football and basketball game score live broadcast platform source code /app development and construction project
VSYNC+三重缓存机制+Choreographer
Performance improvement 2-3 times! The second generation Kunlun core server of Baidu AI Cloud was launched
Phishing identification app
Redis -- lattice connects to redis cluster
嵌入式工程师面试题3-硬件
Mysql 优化
易点易动助力企业设备高效管理,提升设备利用率
通过 代码实例 理解 浅复制 与 深复制
Nacos - 配置管理
Redis——Lettuce连接redis集群