Elk's Logstash long run

Source: Internet
Author: User
Tags logstash

Today introduced about the Logstash of the starting mode, previously said is to use the/usr/local/logstash-f/etc/logstash.conf way to start, so there is a trouble when you shut down the terminal, or CTRL + C, Logstash will exit. Here are a few long-running ways.


1. Service mode

The use of RPM installation, can be/etc/init.d/logstash boot, compile and install the need to write your own startup script


2, Nohup Way

This is the simplest, for the novice

Nohup/usr/local/logstash/bin/logstash-f/etc/logstash/logstash.conf-w 10-l/var/log/logstash/logstash.log &


3. Elegant Screen mode

A screen software is used to run screen, which is the same terminal as the shell, and the process is still running after it is started using ctrl+a+d exit.

Create a separate screen command as follows:

Screen-dms Elk

The elk command created by taking over the connection is as follows:

Screen-r Elk

Startup program:/usr/local/logstash/bin/logstash-f/etc/logstash/logstash.conf

Ctrl+a+d exit, PS Look, Logstash is still running


4, the most recommended Daemontools way

Daemontools is a software name, but the configuration is slightly more complex. So here I am using Python to implement the Supervisord way:

Install First:

Yum Install Python-setuptools

Easy_install Supervisor

Build configuration file (supervisord.conf):

echo_supervisord_conf >/etc/supervisord.conf

In supervisord.conf finally added:

[Program:elkpro_1]

environment=ls_heap_size=5000m

Directory=/usr/local/logstash

Command=/usr/local/logstash/bin/logstash-f/etc/logstash/conf.d/pro1.conf-w 10-l/var/log/logstash/pro1.log

Note: After testing, here the Logstash configuration file must be in the conf.d/directory.

Then start Supervisord-c/etc/supervisord.conf.

Explain:

Logstash will run as a supervisord child process, and you can also use the SUPERVISORCTL command to control the start and stop of a process in a sequence of logstash child processes individually:

Supervisorctl Start Elkpro_1 (support start, stop, restart)

It is also important to note that when you modify supervisord.conf, you need to reload the configuration file using Supervisorctl reload.






This article is from the "Linux" blog, so be sure to keep this source http://syklinux.blog.51cto.com/9631548/1866750

Elk's Logstash long run

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.