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