Install supervisor under CENTOS7 and use

Source: Internet
Author: User
Tags logstash

"Note" The Linux environment must have Python installed

1. Get the Supervisor package: "Https://pypi.python.org/pypi/supervisor"

# wget https://pypi.python.org/packages/80/37/964c0d53cbd328796b1aeb7abea4c0f7b0e8c7197ea9b0b9967b7d004def/ Supervisor-3.3.1.tar.gz

2. Unzip the supervisor-3.3.1.tar.gz and install

# tar ZXVF supervisor-3.3.1.tar.gz && CD supervisor-3.3.1

# python setup.py install

"Possible error": Importerror:no module named Setuptools

"Workaround": There is no setuptools module, indicating that Python is missing this module, we just need to install this module to solve the problem

# wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz

# tar ZXVF setuptools-0.6c11.tar.gz && CD SETUPTOOLS-0.6C11

# python setup.py Build

# python setup.py Install

Then execute the python setup.py Install

3. Create the Supervisor configuration file:

# echo/etc/supervisord.conf > /etc/supervisord.conf

4. Turn on Supervisord service

# supervisord-c/etc/supervisord.conf

  

Update the new configuration to Supervisord

# Supervisorctl Update

  

Restart all programs in the configuration

# Supervisorctl Reload

  

Start a process (Program_name= the program name written in your configuration)

# Supervisorctl start program_name

View the process you are waiting for

# Supervisorctl

Restart a process (Program_name= the name of the program written in your configuration)

# supervisorctl Restart Program_name

Stop All Processes

# supervisorctl stop all

5. View the Supervisord process

The configuration file is as follows

[program:elkpro_1]environment=LS_HEAP_SIZE=5000mdirectory=/opt/logstashcommand=/opt/logstash/bin/logstash -f /etc/logstash/pro1.conf -w 10 -l /var/log/logstash/pro1.log[program:elkpro_2]environment=LS_HEAP_SIZE=5000mdirectory=/opt/logstashcommand=/opt/logstash/bin/logstash -f /etc/logstash/pro2.conf -w 10 -l /var/log/logstash/pro2.log

Install supervisor under CENTOS7 and use

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.