ELK之Logstash启动异常:Logstash could not be started because there is already...

这篇具有很好参考价值的文章主要介绍了ELK之Logstash启动异常:Logstash could not be started because there is already...。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

Logstash启动异常: Logstash could not be started because there is already another instance using the configured data directory. If you wish to run multiple instances, you must change the "path.data" setting.
提示我们已经有一个实例在用data目录了,如果需要配置多个实例,则需要显式的配置path.data的值。

[root@nb002 bin]# ./logstash -f ../config/first-pipeline.conf
Using JAVA_HOME defined java: /usr/local/jdk1.8.0_331
WARNING: Using JAVA_HOME while Logstash distribution comes with a bundled JDK.
DEPRECATION: The use of JAVA_HOME is now deprecated and will be removed starting from 8.0. Please configure LS_JAVA_HOME instead.
Sending Logstash logs to /data/logstash-7.17.4/logs which is now configured via log4j2.properties
[2022-06-27T10:40:55,149][INFO ][logstash.runner          ] Log4j configuration path used is: /data/logstash-7.17.4/config/log4j2.properties
[2022-06-27T10:40:55,176][INFO ][logstash.runner          ] Starting Logstash {"logstash.version"=>"7.17.4", "jruby.version"=>"jruby 9.2.20.1 (2.5.8) 2021-11-30 2a2962fbd1 Java HotSpot(TM) 64-Bit Server VM 25.331-b09 on 1.8.0_331-b09 +indy +jit [linux-x86_64]"}
[2022-06-27T10:40:55,178][INFO ][logstash.runner          ] JVM bootstrap flags: [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingOccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djdk.io.File.enableADS=true, -Djruby.compile.invokedynamic=true, -Djruby.jit.threshold=0, -Djruby.regexp.interruptible=true, -XX:+HeapDumpOnOutOfMemoryError, -Djava.security.egd=file:/dev/urandom, -Dlog4j2.isThreadContextMapInheritable=true]
[2022-06-27T10:40:55,537][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2022-06-27T10:40:55,552][FATAL][logstash.runner          ] Logstash could not be started because there is already another instance using the configured data directory.  If you wish to run multiple instances, you must change the "path.data" setting.
[2022-06-27T10:40:55,558][FATAL][org.logstash.Logstash    ] Logstash stopped processing because of an error: (SystemExit) exit
org.jruby.exceptions.SystemExit: (SystemExit) exit
        at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:747) ~[jruby-complete-9.2.20.1.jar:?]
        at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:710) ~[jruby-complete-9.2.20.1.jar:?]
        at data.logstash_minus_7_dot_17_dot_4.lib.bootstrap.environment.<main>(/data/logstash-7.17.4/lib/bootstrap/environment.rb:94) ~[?:?]

当然我们可以显式的配置path.data的值,让他指向一个新的目录。
也可以将data目录下的.lock文件删除,来解决这个问题。

[root@nb002 logstash-7.17.4]# ls
bin  config  CONTRIBUTORS  data  Gemfile  Gemfile.lock  jdk  lib  LICENSE.txt  logs  logstash-core  logstash-core-plugin-api  modules  NOTICE.TXT  tools  vendor  x-pack
[root@nb002 logstash-7.17.4]# cd data/
[root@nb002 data]# ls -alh
总用量 4.0K
drwxr-xr-x  5 root wheel  84 626 08:28 .
drwxr-xr-x 14 root root  278 626 07:58 ..
drwxr-xr-x  2 root root    6 626 07:58 dead_letter_queue
-rw-r--r--  1 root root    0 626 07:58 .lock
drwxr-xr-x  4 root root   35 626 08:57 plugins
drwxr-xr-x  2 root root    6 626 07:58 queue
-rw-r--r--  1 root root   36 626 07:58 uuid
[root@nb002 data]# rm .lock 
rm:是否删除普通空文件 ".lock"?yes

删除.lock文件后,再次启动则OK文章来源地址https://www.toymoban.com/news/detail-732877.html

END

到了这里,关于ELK之Logstash启动异常:Logstash could not be started because there is already...的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包