flume-sink报错 : close() called when transaction is OPEN - you must either commit or rollback first

Posted 怒上王者

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了flume-sink报错 : close() called when transaction is OPEN - you must either commit or rollback first相关的知识,希望对你有一定的参考价值。

启动flume agent时报错

(SinkRunner-PollingRunner-DefaultSinkProcessor) [ERROR - org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:158)] Unable to deliver event. Exception follows.
java.lang.IllegalStateException: close() called when transaction is OPEN - you must either commit or rollback first
	at com.google.common.base.Preconditions.checkState(Preconditions.java:172)
	at org.apache.flume.channel.BasicTransactionSemantics.close(BasicTransactionSemantics.java:179)
	at org.apache.flume.sink.kafka.KafkaSink.process(KafkaSink.java:255)
	at org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:67)
	at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:145)
	at java.lang.Thread.run(Thread.java:748)
2021-05-13 14:41:07,452 (SinkRunner-PollingRunner-DefaultSinkProcessor) [ERROR - org.apache.flume.sink.kafka.KafkaSink.process(KafkaSink.java:240)] Failed to publish events
java.lang.IllegalStateException: begin() called when transaction is OPEN!
	at com.google.common.base.Preconditions.checkState(Preconditions.java:145)
	at org.apache.flume.channel.BasicTransactionSemantics.begin(BasicTransactionSemantics.java:131)
	at org.apache.flume.sink.kafka.KafkaSink.process(KafkaSink.java:153)
	at org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:67)
	at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:145)
	at java.lang.Thread.run(Thread.java:748)
2021-05-13 14:41:07,453 (SinkRunner-PollingRunner-DefaultSinkProcessor) [ERROR - org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:158)] Unable to deliver event. Exception follows.
org.apache.flume.EventDeliveryException: Failed to publish events
	at org.apache.flume.sink.kafka.KafkaSink.process(KafkaSink.java:252)
	at org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:67)
	at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:145)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: begin() called when transaction is OPEN!
	at com.google.common.base.Preconditions.checkState(Preconditions.java:145)
	at org.apache.flume.channel.BasicTransactionSemantics.begin(BasicTransactionSemantics.java:131)
	at org.apache.flume.sink.kafka.KafkaSink.process(KafkaSink.java:153)
	... 3 more

flume-sink报错 : close() called when transaction is OPEN - you must either commit or rollback first
在确认代码无误的情况下,引起该错误的主要原因是flume启动给的内存不足引起的,
flume-ng 启动文件默认的启动内存为20M
可以修改flume-ng文件:
JAVA_OPTS="-Xmx1024m" #设置大一点,默认是20M

以上是关于flume-sink报错 : close() called when transaction is OPEN - you must either commit or rollback first的主要内容,如果未能解决你的问题,请参考以下文章

flume-sink报错 : close() called when transaction is OPEN - you must either commit or rollback first

flume-sink报错 : close() called when transaction is OPEN - you must either commit or rollback first(代码

错误mycat报错:close connection,reason:stream close ...

checkpoint 防火墙系统报错1--the internal CA certificate failed(内部CA损坏)

Lucene分词报错:”TokenStream contract violation: close() call missing”

Mysql报错Forcing close of thread 139 user: 'root'