Your settings are invalid. Reason: Path "/usr/share/logstash/data" must be a writable directory. It is not writable.

Dung Do Tien Mar 06 2022 114

Hello, I'm using ELK stack to help collect log. I just installed Elastic, Kibana and LogStash and I have created logstash conf file as below: 

logstashiis.conf file

 input {
  beats {
    port => 5050
  }
}
output {
  elasticsearch {
    hosts => ["http://localhost:9200"]
    index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
  }
}

When I try to run the command:

 logstash -f logstashiis.conf

 I got an exception "Your settings are invalid. Reason: Path "/usr/share/logstash/data" must be a writable directory. It is not writable".

 [INFO ] 2022-03-05 04:36:00.297 [main] runner - Starting Logstash {"logstash.version"=>"7.17.1", "jruby.version"=>"jruby 9.2.20.1
 (2.5.8) 2021-11-30 2a2962fbd1 OpenJDK 64-Bit Server VM 11.0.13+8 on 11.0.13+8 +indy +jit [linux-x86_64]"}
[INFO ] 2022-03-05 04:36:00.308 [main] runner - JVM bootstrap flags: [-Xms1g, -Xmx1g, -XX:+UseConcMarkSweepGC, -XX:CMSInitiatingO
ccupancyFraction=75, -XX:+UseCMSInitiatingOccupancyOnly, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djruby.compile.invoked
ynamic=true, -Djruby.jit.threshold=0, -Djruby.regexp.interruptible=true, -XX:+HeapDumpOnOutOfMemoryError, -Djava.security.egd=fil
e:/dev/urandom, -Dlog4j2.isThreadContextMapInheritable=true]
Your settings are invalid. Reason: Path "/usr/share/logstash/data" must be a writable directory. It is not writable.
[FATAL] 2022-03-05 04:36:00.345 [main] Logstash - Logstash stopped processing because of an error: (SystemExit) exit
org.jruby.exceptions.SystemExit: (SystemExit) exit
        at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:747) ~[jruby-complete-9.2.20.1.jar:?]
        at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:710) ~[jruby-complete-9.2.20.1.jar:?]
        at usr.share.logstash.lib.bootstrap.environment.<main>(/usr/share/logstash/lib/bootstrap/environment.rb:94) ~[?:?]

I ran that command inside /usr/share/logstash/data folder, how can I make that folder can writable?

Have 1 answer(s) found.
  • N

    Nitin Kumar Mar 06 2022

    I think you are not run in root account. To access the root account you can try to use the command:

      sudo su

    I hope it works for you.

Leave An Answer
* NOTE: You need Login before leave an answer

* Type maximum 2000 characters.

* All comments have to wait approved before display.

* Please polite comment and respect questions and answers of others.

Popular Tips

X Close