Logstash持久队列文件将所有者更改为root,并且java无法访问
我刚刚将我的麋鹿堆栈从7.0.1更新为7.9.1(使用apt) 系统:Ubuntu 18.04.5 LTS 除了一些权限问题,我将不在这里讨论,我的持久队列尾部文件的权限似乎有问题。 更新page.nnn文件时,它将归root所有,这会导致java失败 复制步骤:Logstash持久队列文件将所有者更改为root,并且java无法访问,java,ruby,ubuntu,logstash,elk,Java,Ruby,Ubuntu,Logstash,Elk,我刚刚将我的麋鹿堆栈从7.0.1更新为7.9.1(使用apt) 系统:Ubuntu 18.04.5 LTS 除了一些权限问题,我将不在这里讨论,我的持久队列尾部文件的权限似乎有问题。 更新page.nnn文件时,它将归root所有,这会导致java失败 复制步骤: 将管道尾部文件文件夹的所有者更改为logstash 使用FileBeat将数据推送到日志存储 检查文件的所有者 错误: /data/logstash/data/queue/my_pipeline$ sudo journalctl -e
/data/logstash/data/queue/my_pipeline$ sudo journalctl -e --unit=logstash | grep FileNotFoundException | tail -1
Oct 21 09:29:06 my_server.my_domain.com logstash[38158]: [2020-10-21T09:29:06,496][ERROR][logstash.agent ]
Failed to execute action {
:action => LogStash::PipelineAction::Create/pipeline_id:my_pipeline, :exception => "Java::JavaLang::IllegalStateException",
:message => "java.io.FileNotFoundException: /data/logstash/data/queue/my_pipeline/page.869 (Permission denied)",
:backtrace => ["org.logstash.execution.AbstractPipelineExt.openQueue(AbstractPipelineExt.java:204)",
"org.logstash.execution.AbstractPipelineExt$INVOKER$i$0$0$openQueue.call(AbstractPipelineExt$INVOKER$i$0$0$openQueue.gen)",
"org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:831)",
"org.jruby.ir.targets.InvokeSite.invoke(InvokeSite.java:207)",
"usr.share.logstash.logstash_minus_core.lib.logstash.java_pipeline.RUBY$method$initialize$0(/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:45)",
"org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:80)",
"org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:70)",
"org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:332)",
"org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:86)",
"org.jruby.RubyClass.newInstance(RubyClass.java:939)",
"org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)",
"org.jruby.ir.targets.InvokeSite.invoke(InvokeSite.java:207)",
"usr.share.logstash.logstash_minus_core.lib.logstash.pipeline_action.create.RUBY$method$execute$0(/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:52)",
"usr.share.logstash.logstash_minus_core.lib.logstash.pipeline_action.create.RUBY$method$execute$0$__VARARGS__(/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb)",
"org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:80)",
"org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:70)",
"org.jruby.ir.targets.InvokeSite.invoke(InvokeSite.java:207)",
"usr.share.logstash.logstash_minus_core.lib.logstash.agent.RUBY$block$converge_state$2(/usr/share/logstash/logstash-core/lib/logstash/agent.rb:357)",
"org.jruby.runtime.CompiledIRBlockBody.callDirect(CompiledIRBlockBody.java:138)",
"org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:58)",
"org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:52)",
"org.jruby.runtime.Block.call(Block.java:139)", "org.jruby.RubyProc.call(RubyProc.java:318)",
"org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:105)",
"java.lang.Thread.run(Thread.java:748)"]
}
我已经通过Logstash的配置文件获取了源代码,但找不到任何设置。我怀疑这与我的JRE有关,但由于我不够精通,我无法找到原因
tl;dr:如何使Logstash永久拥有Logstash的持久队列尾部文件?您用于启动Logstash的用户是什么?Logstash在系统启动时作为服务启动,或者通过从Logstash.service运行systemctl start Logstash.service:[服务]Type=simple User=logstash Group=logstash您是否能够为
ps-ef | grep logstash
您用于启动logstash的用户添加输出?logstash在系统启动时作为服务启动,或者通过运行systemctl start logstash.service从logstash.service:[服务]Type=simple User=logstash Group=logstash您是否能够为ps-ef | grep logstash添加输出
/data/logstash/data/queue/my_pipeline$ ls -l
total 8
-rw-r--r-- 1 root root 34 Oct 21 09:12 checkpoint.head
-rw-r--r-- 1 root root 67108864 Oct 21 09:12 page.869
/data/logstash/data/queue/my_pipeline$ sudo journalctl -e --unit=logstash | grep FileNotFoundException | tail -1
Oct 21 09:29:06 my_server.my_domain.com logstash[38158]: [2020-10-21T09:29:06,496][ERROR][logstash.agent ]
Failed to execute action {
:action => LogStash::PipelineAction::Create/pipeline_id:my_pipeline, :exception => "Java::JavaLang::IllegalStateException",
:message => "java.io.FileNotFoundException: /data/logstash/data/queue/my_pipeline/page.869 (Permission denied)",
:backtrace => ["org.logstash.execution.AbstractPipelineExt.openQueue(AbstractPipelineExt.java:204)",
"org.logstash.execution.AbstractPipelineExt$INVOKER$i$0$0$openQueue.call(AbstractPipelineExt$INVOKER$i$0$0$openQueue.gen)",
"org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:831)",
"org.jruby.ir.targets.InvokeSite.invoke(InvokeSite.java:207)",
"usr.share.logstash.logstash_minus_core.lib.logstash.java_pipeline.RUBY$method$initialize$0(/usr/share/logstash/logstash-core/lib/logstash/java_pipeline.rb:45)",
"org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:80)",
"org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:70)",
"org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:332)",
"org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:86)",
"org.jruby.RubyClass.newInstance(RubyClass.java:939)",
"org.jruby.RubyClass$INVOKER$i$newInstance.call(RubyClass$INVOKER$i$newInstance.gen)",
"org.jruby.ir.targets.InvokeSite.invoke(InvokeSite.java:207)",
"usr.share.logstash.logstash_minus_core.lib.logstash.pipeline_action.create.RUBY$method$execute$0(/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:52)",
"usr.share.logstash.logstash_minus_core.lib.logstash.pipeline_action.create.RUBY$method$execute$0$__VARARGS__(/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb)",
"org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:80)",
"org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:70)",
"org.jruby.ir.targets.InvokeSite.invoke(InvokeSite.java:207)",
"usr.share.logstash.logstash_minus_core.lib.logstash.agent.RUBY$block$converge_state$2(/usr/share/logstash/logstash-core/lib/logstash/agent.rb:357)",
"org.jruby.runtime.CompiledIRBlockBody.callDirect(CompiledIRBlockBody.java:138)",
"org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:58)",
"org.jruby.runtime.IRBlockBody.call(IRBlockBody.java:52)",
"org.jruby.runtime.Block.call(Block.java:139)", "org.jruby.RubyProc.call(RubyProc.java:318)",
"org.jruby.internal.runtime.RubyRunnable.run(RubyRunnable.java:105)",
"java.lang.Thread.run(Thread.java:748)"]
}