Logstash with systemctl not work


(Lm Yj Q) #1

after I installed x-pack, I could only make logstash work by
/usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/index_from_redis.conf --config.reload.automatic --log.level=debug

sudo systemctl start logstash.service just don't work.

I have changed the setting in/etc/systemd/system/logstash.serviceto use the right .conf file I

[Unit]
Description=logstash

[Service]
Type=simple
User=logstash
Group=logstash
# Load env vars from /etc/default/ and /etc/sysconfig/ if they exist.
# Prefixing the path with '-' makes it try to load, but if the file doesn't
# exist, it continues onward.
EnvironmentFile=-/etc/default/logstash
EnvironmentFile=-/etc/sysconfig/logstash
ExecStart=/usr/share/logstash/bin/logstash "--path.settings" "/etc/logstash/conf.d/index_from_redis.conf"
Restart=always
WorkingDirectory=/
Nice=19
LimitNOFILE=16384

[Install]
WantedBy=multi-user.target

And we can see the process

root@spiderman:/var/log/logstash# ps aux|grep logstash
root     18841  0.0  0.0  22572  1272 pts/9    S+   17:29   0:00 tmux new -s logstash
root     18981 55.5  2.5 8514844 625776 pts/8  Sl+  17:29  18:54 /usr/lib/jvm/java-8-oracle/bin/java -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+DisableExplicitGC -Djava.awt.headless=true -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError -Xmx1g -Xms256m -Xss2048k -Djffi.boot.library.path=/usr/share/logstash/vendor/jruby/lib/jni -Xbootclasspath/a:/usr/share/logstash/vendor/jruby/lib/jruby.jar -classpath : -Djruby.home=/usr/share/logstash/vendor/jruby -Djruby.lib=/usr/share/logstash/vendor/jruby/lib -Djruby.script=jruby -Djruby.shell=/bin/sh org.jruby.Main /usr/share/logstash/lib/bootstrap/environment.rb logstash/runner.rb -f /etc/logstash/conf.d/index_from_redis.conf --config.reload.automatic --log.level=debug
logstash 29588  0.0  0.1 5025000 46300 ?       SNsl 18:03   0:00 /usr/bin/java -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+DisableExplicitGC -Djava.awt.headless=true -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError -Xmx1g -Xms256m -Xss2048k -Djffi.boot.library.path=/usr/share/logstash/vendor/jruby/lib/jni -Xbootclasspath/a:/usr/share/logstash/vendor/jruby/lib/jruby.jar -classpath : -Djruby.home=/usr/share/logstash/vendor/jruby -Djruby.lib=/usr/share/logstash/vendor/jruby/lib -Djruby.script=jruby -Djruby.shell=/bin/sh org.jruby.Main /usr/share/logstash/lib/bootstrap/environment.rb logstash/runner.rb --path.settings /etc/logstash/conf.d/index_from_redis.conf
root     29645  0.0  0.0  15960  1036 pts/10   S+   18:03   0:00 grep --color=auto logstash

And the there is no new log created after that,
root@spiderman:/var/log/logstash# tail -1f logstash-plain.log

[2017-05-12T15:39:09,874][FATAL][logstash.runner          ] An unexpected error occurred! {:error=>#<ArgumentError: Setting "xpack.monitoring.elasticsearch.password" hasn't been registered>, :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/settings.rb:29:in `get_setting'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:61:in `set_value'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:80:in `merge'", "org/jruby/RubyHash.java:1342:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:80:in `merge'", "/usr/share/logstash/logstash-core/lib/logstash/settings.rb:115:in `validate_all'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:210: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:183: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)'"]}

It is 18:00:00 Now, I can't find the log of logstash.

Thanks


(Magnus B├Ąck) #2

Have you tried fixing the problem Logstash complains about in the final log entry ("Setting "xpack.monitoring.elasticsearch.password" hasn't been registered")?


(Lm Yj Q) #3

Yeah, I've done that to make kibana and elasticsearch work.


#4

Hi is your problem solved? I have the same problem.
Regards


(Lm Yj Q) #5

There is a long story after that... I reinstalled ELK without x-pack in the end.


(system) #6

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