我正在使用来测试我的配置:
./logstash -f /etc/logstash/conf.d/your_config_file.conf --config.test_and_exit
并出现以下错误:
[INFO ] 2020-10-15 10:25:21.481 [main] runner - Starting Logstash {"logstash.version"=>"7.9.2",
"jruby.version"=>"jruby 9.2.13.0 (2.5.7) 2020-08-03 9a89c94bcc OpenJDK 64-Bit Server VM
11.0.8+10-post-Ubuntu-0ubuntu118.04.1 on 11.0.8+10-post-Ubuntu-0ubuntu118.04.1 +indy +jit
[linux-x86_64]"}
[FATAL] 2020-10-15 10:25:21.586 [main] runner - An unexpected error occurred! {:error=>#
<ArgumentError: Path "/usr/share/logstash/data/queue" must be a writable directory.
It is not writable.>, :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/settings.rb:528:in
`validate'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:288:in `validate_value'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:199:in `block in
validate_all'", "org/jruby/RubyHash.java:1415:in `each'", "/usr/share/logstash/logstash-
core/lib/logstash/settings.rb:198:in `validate_all'", "/usr/share/logstash/logstash-
core/lib/logstash/runner.rb:312:in `execute'",
"/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/command.rb:67:in `run'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:268:in `run'", "/usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/clamp-0.6.5/lib/clamp/command.rb:132:in `run'",
"/usr/share/logstash/lib/bootstrap/environment.rb:88:in `<main>'"]}
[ERROR] 2020-10-15 10:25:21.589 [main] Logstash - java.lang.IllegalStateException: Logstash
stopped processing because of an error: (SystemExit) exit
我尝试通过以下方式授予alogstash用户到完整目录的权限:
/usr/share$ sudo chown -R logstash.logstash logstash
但仍然是相同的错误。请帮忙
答案 0 :(得分:0)
chown
将更改目录的所有权,但不会更改权限。 Logstash抱怨用于启动Logstash的用户没有对/usr/share/logstash
chmod
将有助于更改权限。选中this,以了解有关该命令的更多信息。