LogStash 错误:Logstash could not be started because there is already another instance usin

$ ./bin/logstash -f ./temp/std_std.conf 

错误提示:

Sending Logstash logs to /usr/local/logstash/logstash-6.5.0/logs which is now configured via log4j2.properties
[2018-11-20T12:23:45,931][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2018-11-20T12:23:46,088][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.
[2018-11-20T12:23:46,130][ERROR][org.logstash.Logstash    ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

原因:之前运行的instance有缓冲,保存在path.data里面有.lock文件,删除掉就可以。
解决办法:

  • 在 logstash.yml 文件中找到 Data path 的路径(默认在安装目录的data目录下)
# ------------ Data path ------------------
#
# Which directory should be used by logstash and its plugins
# for any persistent needs. Defaults to LOGSTASH_HOME/data
#
path.data: 
  • 查看是否存在 .lock 文件,如果存在把它删除
data$ ls -alh
总用量 20K
drwxr-sr-x  4 tingshuo staff 4.0K 11月 20 11:42 .
drwxr-sr-x 14 tingshuo staff 4.0K 11月 20 11:42 ..
drwxr-sr-x  2 tingshuo staff 4.0K 11月 20 11:42 dead_letter_queue
-rw-r--r--  1 tingshuo staff    0 11月 20 11:42 .lock
drwxr-sr-x  2 tingshuo staff 4.0K 11月 20 11:42 queue
-rw-r--r--  1 tingshuo staff   36 11月 20 11:42 uuid
  • 删除
data$ rm .lock
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容