当前位置: 首页 > news >正文

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) exitat 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

END

http://www.lryc.cn/news/168182.html

相关文章:

  • Matlab Simulink支持system generator插件
  • redis设计规范
  • 用于非线性多载波卫星信道的多输入多输出符号速率信号数字预失真器DPD(Matlab代码实现)
  • 【Spark】用udf和withColumn在dafaframe中创建新列
  • AIGC 设计能替代真正的设计师设计吗?
  • 【1++的C++进阶】之emplace详解
  • React入门
  • 第三方登录以及验证
  • MS SQL Server问题汇总
  • 在线海报图片设计器、图片编辑器源码/仿照稿定设计源码
  • KMP算法(C++)
  • C++的异常类型与多级catch匹配
  • 查询IP地址可得到哪些信息
  • 考研算法47天:01背包
  • Docker实战技巧(一):Kubernetes基础操作实战
  • android java读写yaml文件
  • 科学计算器网站Desmos网站
  • 结构体-时间的计算
  • pt24django教程
  • Golang开发-new关键字
  • 遗传算法与粒子群算法的Python实现
  • 无涯教程-JavaScript - ASINH函数
  • ActiveMQ面试题(一)
  • node:glob语法以及常用的文件查找库glob、fast-glob
  • 饲料添加剂 微生物 屎肠球菌
  • 二叉搜索树经典笔试题【力扣、牛客】
  • docker系列(1) - docker环境篇
  • web安全漏洞-SQL注入攻击实验
  • 直接插入排序(C++实现)
  • 【k8s】Pod 的钩子