问题
Hi i am new to the internals of ELK stack
running a logstash process in background, and when it got picked up the matching file pattern, it says as in below
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.
回答1:
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
.
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.
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
(make sure the directory is writable)
or specify in logstash.yml
file under /etc/logstash/
for each instance.
回答2:
That means you have two Logstash instances running and they cannot share the same data directory. You either need to kill the other instance or if you really want to have two instances running, you need to configure them to have different data directories.
Inside logstash.yml
, you need to change the path.data setting for each instance.
来源:https://stackoverflow.com/questions/51086824/logstash-could-not-be-started-when-running-multiple-instances-path-data-settin