Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

logstash could not be started when running multiple instances - path.data setting

Tags:

logstash

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.
like image 218
Sai Koti Avatar asked Jun 28 '18 15:06

Sai Koti


People also ask

What is Logstash Elasticsearch?

Logstash is a light-weight, open-source, server-side data processing pipeline that allows you to collect data from a variety of sources, transform it on the fly, and send it to your desired destination. It is most often used as a data pipeline for Elasticsearch, an open-source analytics and search engine.

Why can't I start Logstash on another instance?

[2019-03-11T10:47:12,719] [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. could you help me please,

How do I know if Logstash is running?

Check the services that are running on your server: If you run this, and it says Active: active (running) then you already have logstash running. To temporarily stop this instance you can run: If you run through multiple tests, you may have to continually stop the service.

How to configure data sync in Logstash?

Step 1: Create a data sync conf file in the Logstash directory Step 2: Ensure Identical Names: When configuring the conf file, ensure that the index names are identical in both the target and source clusters. Refer to the screenshot below. Step 3: Running Logstash: Once you have configured the conf file, run Logstash

How does Logstash migrate data from one cluster to another?

After running the command, Logstash will copy all of the indexes in the source cluster to the target cluster, carrying with it the mapping information. Next, it will begin gradually migrating the data inside the indexes.


2 Answers

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.

like image 38
Val Avatar answered Sep 17 '22 16:09

Val


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.

like image 69
Sufiyan Ghori Avatar answered Sep 21 '22 16:09

Sufiyan Ghori