运行多个实例时,logstash无法启动-path.data设置

问题描述:

我是ELK堆栈内部的新手

Hi i am new to the internals of ELK stack

在后台运行logstash进程,当它选择了匹配的文件模式时,如下所示

running a logstash process in background, and when it got picked up the matching file pattern, it says as in below

我想在这里了解path.data选项的重要性,请帮帮我

i want to understand here what is the importance of path.data option, Please help me out

[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.

Logstash及其插件将

path.data目录用于存储数据的任何持久性需求,并且对于所运行的每个实例,该目录都应有所不同,因为Logstash不允许多个实例共享同一path.data.

path.data directory is used by Logstash and its plugins for any persistent needs to store data, and it need to be different for each instance you are running, since Logstash does not allow multiple instances to share the same path.data.

默认情况下,其值设置为LOGSTASH_HOME/data,在debian和rpm下,其值设置为/usr/share/logstash/data,除非明确指定,否则它将自动分配给第一个logstash实例.

By default its value is set to, LOGSTASH_HOME/data, which, under debian and rpm is /usr/share/logstash/data, and it is automatically assigned to first logstash instance unless explicitly specified.

如果要运行多个logstash实例,则需要通过命令定义path.data

If you want to run multiple logstash instances, you need to define the path.data either by command,

bin/logstash -f <config_file.conf> --path.data PATH

(确保目录可写)

或在每个实例的/etc/logstash/下的logstash.yml文件中指定.

or specify in logstash.yml file under /etc/logstash/ for each instance.