项目logstash服务启动时报错,报错如下:

YAML extension failed to load.
Check your env for conflicting versions of SnakeYAML
See https://github.com/jruby/jruby/wiki/FAQs#why-does-the-psych-yaml-extension-fail-to-load-in-my-environment
[FATAL] 2022-12-06 15:25:52.782 [main] Logstash - Logstash stopped processing because of an error: (GemspecError) 
[!] There was an error while loading `logstash-core-plugin-api.gemspec`: load error: psych -- java.lang.RuntimeException: BUG: we can not copy embedded jar to temp directory
Does it try to require a relative path? That's been removed in Ruby 1.9. Bundler cannot continue.

经过排查是由于/tmp权限异常导致,logstash运行用户无权限对/tmp目录进行操作。

解决办法

修复权限
chmod a+rwx,o+t /tmp
更改配置文件

编辑jvm.options文件,修改或删除-Djava.io.tmpdir=${HOME}

参考文章:https://discuss.elastic.co/t/logstash-is-failing-when-running-as-a-service-due-to-logstash-core-plugin-api-gemspec-error/271385

END

本文标题:logstash启动报错we can not copy embedded jar to temp directory

本文作者:宇宙最帅的男人

本文链接:https://lolicp.com/linux/202206482.html

版权声明:转载或者引用本文内容请注明来源及原作者,本文著作权归作者 (宇宙最帅的男人) 所有。

除非另有说明,本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议

最后修改:2022 年 12 月 06 日
如果觉得我的文章对你有用,请随意赞赏