Stop logsstash

Hello, I can't stop Logstash so I can't test any config file on my mac.

Here the error : I3893-2:6.4.1 gongon$ logstash -f first-pipeline.conf
Sending Logstash logs to /usr/local/Cellar/logstash/6.4.1/libexec/logs which is now configured via log4j2.properties
[2019-01-22T18:43:32,589][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified
[2019-01-22T18:43:32,647][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.
[2019-01-22T18:43:32,668][ERROR][org.logstash.Logstash ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

This command doesn't work : '--pipeline.unsafe_shutdown`
Can i use it on my mac ???
Could you help me ?

You use the command line parameter like this:

./logstash -f first-pipeline.conf --path.data /path/to/writable/directory

:grinning: thank you very much for your answer .Here the error:
I3893-2:6.4.1 gongon$ logstash -f first-pipeline.conf --path.data /path/to/writable/directory
[FATAL] 2019-01-29 16:00:12.641 [main] runner - An unexpected error occurred! {:error=>#<ArgumentError: Path "/path/to/writable/directory" does not exist, and I failed trying to create it: Errno::EACCES - Permission denied - /path>, :backtrace=>["/usr/local/Cellar/logstash/6.4.1/libexec/logstash-core/lib/logstash/settings.rb:475:in block in value'", "org/jruby/RubyKernel.java:1741:intap'", "/usr/local/Cellar/logstash/6.4.1/libexec/logstash-core/lib/logstash/settings.rb:467:in value'", "/usr/local/Cellar/logstash/6.4.1/libexec/logstash-core/lib/logstash/settings.rb:64:inget_value'", "/usr/local/Cellar/logstash/6.4.1/libexec/logstash-core/lib/logstash/environment.rb:92:in block in LogStash'", "/usr/local/Cellar/logstash/6.4.1/libexec/logstash-core/lib/logstash/settings.rb:125:inblock in post_process'", "org/jruby/RubyArray.java:1734:in each'", "/usr/local/Cellar/logstash/6.4.1/libexec/logstash-core/lib/logstash/settings.rb:124:inpost_process'", "/usr/local/Cellar/logstash/6.4.1/libexec/logstash-core/lib/logstash/util/settings_helper.rb:26:in post_process'", "/usr/local/Cellar/logstash/6.4.1/libexec/logstash-core/lib/logstash/runner.rb:241:inexecute'", "/usr/local/Cellar/logstash/6.4.1/libexec/vendor/bundle/jruby/2.3.0/gems/clamp-0.6.5/lib/clamp/command.rb:67:in run'", "/usr/local/Cellar/logstash/6.4.1/libexec/logstash-core/lib/logstash/runner.rb:237:inrun'", "/usr/local/Cellar/logstash/6.4.1/libexec/vendor/bundle/jruby/2.3.0/gems/clamp-0.6.5/lib/clamp/command.rb:132:in run'", "/usr/local/Cellar/logstash/6.4.1/libexec/lib/bootstrap/environment.rb:73:in'"]}
[ERROR] 2019-01-29 16:00:12.709 [main] Logstash - java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit
I3893-2:6.4.1 gongon$

Andreas did not mean for you to take that path literally. Create a new directory called something like "logstash-data" somewhere that you can write to, for example, under /tmp or in your home directory. So if your home directory is /home/gongon you would create /home/gongon/logstash-data. Then run logstash using

--path.data /home/gongon/logstash-data

or, perhaps better

--path.data /home/gongon/logstash-data/$$

I am very sorry :slight_smile: of course.
Thank very much it works
But DO you Know how I can really stop the instance of logstash which are running, it was a test.

If logstash is consuming a stdin input it will exit when it receives end-of-file. Otherwise it will run forever unless something external kills it.

Is it a good idea to remove logstash and set up again ??

What problem are you hoping that would fix?

1 Like

Stop the instance of logstash that is running and i can't use.Because of the input like this:input {
file {
path => "/tmp/access_log"

}

I do not have a Mac to test on, but something like 'ps aux | grep logstash' should show you which process is running logstash. Then doing 'kill' on the process id of that process should stop it.

OK:pensive:
I3893-2:6.4.1 gongon$ ps aux | grep logstash
gongon 1516 0,0 0,0 2444056 800 s000 S+ 5:12 0:00.01 grep logstash

Which one is the ID ?

That does not show an instance of logstash running. Do you still get this error?

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

:smile: I don't.Thank very much.
Why it has stopped ?

The logstash process that was running exited for some reason. I do not know why.

:grinning: thank you very much for al l: your time your good answers ...

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.