"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