I cannot start logstash on my machine. Error message inside

The following is the test command from the tutorial:

./logstash -e 'input { stdin { } } output { stdout {} }'

The following is the error.

WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults
Could not find log4j2 configuration at path //usr/share/logstash/config/log4j2.properties. Using default config which logs to console
01:55:14.242 [main] FATAL logstash.runner - An unexpected error occurred! {:error=>#<ArgumentError: Path "/usr/share/logstash/data" must be a writable directory. It is not writable.>, :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/settings.rb:433:in `validate'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:216:in `validate_value'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:132:in `validate_all'", "org/jruby/RubyHash.java:1342:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:131:in `validate_all'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:217:in `execute'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:185:in `run'", "/usr/share/logstash/vendor/bundle/jruby/1.9/gems/clamp-0.6.5/lib/clamp/command.rb:132:in `run'", "/usr/share/logstash/lib/bootstrap/environment.rb:71:in `(root)'"]}

As for the error message part that says:

Path "/usr/share/logstash/data" must be a writable directory. It is not writable.

The directory is owned and writable by logstash.

Can anyone suggest any solutions?

3 Likes

The directory /usr/share/logstash must be owned by logstash and the permission of data directory should be 777

$ chown -R logstash.logstash /usr/share/logstash
$ chmod 777 /usr/share/logstash/data

Also check the user who owns logstash in /etc/default/logstash by default it is logstash.

.................................
................................
LS_USER="logstash"
LS_GROUP="logstash"
...............................
..............................

5 Likes

I ran your commands and the ownership of /usr/share/logstash are fine. Initially the /etc/default/logstash was owned by root actually but I fixed it and it is now owned by logstash too. However, when I ran the same command as above now, I get nothing out of it. Not even an error message. The command just runs indefinitely blocking the command line. It's stuck somewhere.

Edit:
Nevermind, it worked. It just too a long time to set up the pipeline for some reason. Thank you :slight_smile:

1 Like

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