How to install and configure the supervisor daemon under centos7

How to install and configure the supervisor daemon under centos7

Newbie, record it yourself

1. Install supervisor. Supervisor is developed based on Python. When you install Supervisor, Python dependencies are automatically installed, so no additional installation is required.

# yun install supervisor

2. After successful installation, check the relevant files and directories generated under /etc

supervisord.conf is the default configuration file

supervisord.d is the directory where separate configuration files for other programs are stored

3. Configure supervisord.conf

For all parameters, please refer to the official documentation. There are too many configuration items for us to understand. We only need to modify one place and keep the others unchanged.

# vim /etc/supervisord.conf

Locate the last [include] item in the document and change files = supervisord.d/*.ini to files = supervisord.d/*.conf to load the configuration of other applications.

4. Add a separate configuration file for the application (dotnet core)

Create a new configuration file in the supervisord.d directory

# touch /etc/supervisord.d/FirstApi.conf

Open the file and add the following content

[program:FirstApi]
#Command to execute command=dotnet FirstApi.dll
#Command execution directory directory=/home/www/first
#Environment variable environment=ASPNETCORE__ENVIRONMENT=Production
#Process execution user identity<br> user=root<br> stopsignal=INT
#Whether to start automatically autostart=true
#Whether to automatically restart autorestart=true
#Automatic restart interval seconds startsecs=1
#Standard error log stderr_logfile=/var/log/FirstApi.err.log
#Standard output log stdout_logfile=/var/log/FirstApi.out.log

5. Restart the supervisor service

# supervisord -c /etc/supervisord.conf

If the prompt "Another program is already listening on a port that one of our HTTP servers" appears, it means that the service is already running. You can restart the service by following the steps below.

#Enter the console# supervisorctl
#Reread the configuration
#Update configuration update
#Start all configurations start all
#Check the status after success 

At this time, visit the program address again and find that the project has run successfully!

This is the end of this article about how to install and configure the supervisor daemon under centos7. For more information about installing supervisor under centos7, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Building .NET Core 2.0 + Nginx + Supervisor environment under Centos7 system
  • Detailed tutorial on using supervisor in centos7

<<:  Vue uses element-ui to implement menu navigation

>>:  Basic usage of find_in_set function in mysql

Recommend

XHTML 1.0 Reference

Arrange by functionNN : Indicates which earlier ve...

Detailed explanation of how to create MySql scheduled tasks in navicat

Detailed explanation of creating MySql scheduled ...

JavaScript realizes magnifying glass special effects

The effect to be achieved: When the mouse is plac...

Install MySQL 5.7.17 in win10 system

Operating system win10 MySQL is the 64-bit zip de...

In-depth understanding of MySQL master-slave replication thread state transition

Preface The basic principle of MySQL master-slave...

Detailed explanation of the installation steps of the MySQL decompressed version

1. Go to the official website: D:\mysql-5.7.21-wi...

MySQL slow query pitfalls

Table of contents 1. Slow query configuration 1-1...

How to install docker and portainer in kali

With the emergence of docker, many services have ...

Teach you how to implement the observer mode in Javascript

Table of contents What is the Observer Pattern? S...

Detailed tutorial on installing nvidia driver + CUDA + cuDNN in Ubuntu 16.04

Preparation 1. Check whether the GPU supports CUD...

How to quickly clean up billions of data in MySQL database

Today I received a disk alarm exception. The 50G ...