当前位置: 动力学知识库 > 问答 > 编程问答 >

elasticsearch - How to stop a logstash Config file running in Ubuntu?

问题描述:

Im running my logstash config file in Ubuntu using the following command.

/opt/logstash/bin/logstash -f /etc/logstash/conf.d/logstash.conf

Its working, However I recently realized that every time I run this command it starts another instance. Now I think there are six instances running. Because each new record i create shows as six in elasticsearch.

How can I stop all these other instances and is there any way to check how many are running?

Thanks

网友答案:

You can use the pkill command and specify the name of the process(es) you want to kill

pkill logstash

Or the killall command works as well the same way

killall logstash
网友答案:

As Val states, pkill should work to resolve what you are facing.

To avoid this in future why don't you create a small service file so which uses a PID file so you can't have multiple instances running? Here is what I did:

http://www.logstashbook.com/code/3/logstash-central.init

分享给朋友:
您可能感兴趣的文章:
随机阅读: