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

$ ./bin/logstash -f ./myconfig/conf.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

 

你可能感兴趣的:(Centos7)