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

1. 确认代码无误(根据情况修改,表示若获得不了数据不会自动commit或者rollback):

Event event = channel.take();
if (event == null) {
return Status.BACKOFF;
}

I changed it to:

if (event == null) {
transaction.commit();
return Status.BACKOFF;
}

http://grokbase.com/t/flume/user/12be2xfgg5/custom-sink-close-called-when-transaction-is-open-error

2. 确认flume启动给足了内存:

查看flume-ng文件:

JAVA_OPTS="-Xmx1024m"    #设置大一点,默认是20M

可参考:http://blog.csdn.net/panguoyuan/article/details/39555239

 

posted on 2017-02-10 15:49  霏霏暮雨  阅读(2815)  评论(0编辑  收藏  举报

导航