Version
OS:CentOS7.9
JDK:1.8
Kafka:2.12-1.0.2
PS
日常工作开发问题整理,不定期更新ing…
QA
1、Kafka客户端连接失败
通过查看应用日志,发现有大量跟kafka相关内容滚屏,如图所示:
此时,kafka已无法对外提供服务,导致一系列服务中断。。。
经过排查发现,有消费者写DB失败了,如图所示:
2024-11-25 01:56:09,324 ERROR KafkaMessageListenerContainer$ListenerConsumer:149 -Error handler threw an exception
org.springframework.kafka.KafkaException: Seek to current after exception; nested exception is org.springframework.kafka.listener.ListenerExecutionFailedException: Listener method 'public void com.dudua.soc.kafka.MyConsumer.onXxxMsg(org.apache.kafka.clients.consumer.ConsumerRecord<java.lang.String, java.lang.String>) throws java.lang.Exception' threw exception; nested exception is org.springframework.jdbc.UncategorizedSQLException:
### Error updating database. Cause: java.sql.SQLException: The table 't_xxx' is full
### The error may exist in class path resource [mappers/Xxx.xml]
### The error may involve com.dudua.soc.mapper.Xxx.insertBatch-Inline
### The error occurred while setting parameters
### Cause: java.sql.SQLException: The table 't_xxx' is full
; uncategorized SQLException; SQL state [HY000]; error code [1114]; The table 't_xxx' is full; nested exception is java.sql.SQLException: The table 't_xxx' is full
由于数据量比较大,导致批插直接fail,而后Producer还是继续写,Consumer 写DB还是fail,最终导致Kafka 服务不可用!
服务器内存调大,重启服务器,再次查看日志,发现所有服务都已正常运行。