你可以的,加油

logstash自带的持久化队列中读取数据一些情况下出现错误

Logstash | 作者 tacsklet | 发布于2017年09月29日 | 阅读数:4658

用的logstash5.2.2版本,input用的log4j,没有filter,output使用es,
使用持久化队列时候如果只有一个socket连接就没有问题,如果有多个socket连接同时写数据,从队列中取数据时就会读不全数据,有时会报如下错误:
Exception in thread "[main]>worker0" java.lang.IndexOutOfBoundsException: bitIndex < 0: -53
at java.util.BitSet.set(BitSet.java:444)
at org.logstash.ackedqueue.Page.ack(Page.java:104)
at org.logstash.ackedqueue.Queue.ack(Queue.java:538)
at org.logstash.ackedqueue.Batch.close(Batch.java:26)
at org.logstash.ackedqueue.ext.JrubyAckedBatchExtLibrary$RubyAckedBatch.ruby_close(JrubyAckedBatchExtLibrary.java:80)
at org.logstash.ackedqueue.ext.JrubyAckedBatchExtLibrary$RubyAckedBatch$INVOKER$i$0$0$ruby_close.call(JrubyAckedBatchExtLibrary$RubyAckedBatch$INVOKER$i$0$0$ruby_close.gen)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:134)
at rubyjit.LogStash::Util::WrappedAckedQueue::ReadBatch$$close_e247364e63c9faf08f96851045ee4ec60f34d7f32125039532.__file__(/app/logstash-5.2.2/logstash-core/lib/logstash/util/wrapped_acked_queue.rb:231)
at rubyjit.LogStash::Util::WrappedAckedQueue::ReadBatch$$close_e247364e63c9faf08f96851045ee4ec60f34d7f32125039532.__file__(/app/logstash-5.2.2/logstash-core/lib/logstash/util/wrapped_acked_queue.rb)
at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:141)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:134)
at rubyjit.LogStash::Util::WrappedAckedQueue::ReadClient$$close_batch_295a96cea296023eecbe072eddb24aa21882d23c2125039532.block_0$RUBY$__file__(/app/logstash-5.2.2/logstash-core/lib/logstash/util/wrapped_acked_queue.rb:179)
at rubyjit$LogStash::Util::WrappedAckedQueue::ReadClient$$close_batch_295a96cea296023eecbe072eddb24aa21882d23c2125039532$block_0$RUBY$__file__.call(rubyjit$LogStash::Util::WrappedAckedQueue::ReadClient$$close_batch_295a96cea296023eecbe072eddb24aa21882d23c2125039532$block_0$RUBY$__file__)
at org.jruby.runtime.CompiledBlock19.yield(CompiledBlock19.java:135)
at org.jruby.runtime.Block.yield(Block.java:142)
at org.jruby.ext.thread.Mutex.synchronize(Mutex.java:149)
at org.jruby.ext.thread.Mutex$INVOKER$i$0$0$synchronize.call(Mutex$INVOKER$i$0$0$synchronize.gen)
at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:143)
at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:154)
at rubyjit.LogStash::Util::WrappedAckedQueue::ReadClient$$close_batch_295a96cea296023eecbe072eddb24aa21882d23c2125039532.__file__(/app/logstash-5.2.2/logstash-core/lib/logstash/util/wrapped_acked_queue.rb:178)
at rubyjit.LogStash::Util::WrappedAckedQueue::ReadClient$$close_batch_295a96cea296023eecbe072eddb24aa21882d23c2125039532.__file__(/app/logstash-5.2.2/logstash-core/lib/logstash/util/wrapped_acked_queue.rb)
at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:181)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.ast.WhileNode.interpret(WhileNode.java:131)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:74)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:225)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:219)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:202)
at org.jruby.ast.FCallTwoArgNode.interpret(FCallTwoArgNode.java:38)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
at org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:206)
at org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:194)
at org.jruby.runtime.Interpreted19Block.call(Interpreted19Block.java:125)
at org.jruby.runtime.Block.call(Block.java:101)
at org.jruby.RubyProc.call(RubyProc.java:300)
at org.jruby.RubyProc.call(RubyProc.java:230)
at org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:99)
at java.lang.Thread.run(Thread.java:748)

怎么解决比较好?
已邀请:

要回复问题请先登录注册