About the use and configuration of supervisor

Source: Internet
Author: User

The angel of the wide Love wrote an article to be put in front first.

https://segmentfault.com/n/1330000004918556

Then I post some of my own summaries and use configuration records.

Because today by the little angel classmate instigation to use, has not used to want to use a bit by the way to summarize into their own things.

First of all, I personally think that the supervisor implementation of Python uses the concept of daemon to implement the concept of a package process.

He can help you with the process of completing the fail restart, logging, ensuring online, shutdown self-booting, and a range of functions.

When using the supervisor process to die, the boot daemon can help you to re-start the process of the work, do not have to repeat the manual to restart the process, greatly improve the stability.

So it can be understood that the supervisor process itself is a daemon of his initiation process, and as long as he does not die, he can improve the stability of the process.

Said so much let me talk about how to use and how to configure.

First I was using PIP installed. In addition the top of that article is the use of Apt-get directly installed so both methods can be seen. I'm only here to describe the processes and methods used for using PIP installation.

This is actually a quick tutorial on official documents.

Install supervisor using PIP Install Supervisor

Then supervisor will automatically be added to the Etc/local/bin and then two commands can be used.

1. Supervisord

2. Supervisorctl

I am not going to talk about the use of these two orders to move forward.

I use the computer to switch to root permissions, as the document says, using commands

echo_supervisord_conf >/etc/supervisord.conf

In the ETC directory to generate a Supervisord configuration file, this configuration file will be mentioned above in the command 1 in the default wheel path to find and use the configuration file to start the supervisor process.

That.. I know the truth, why I have seen some of their own written configuration files like this.

[program:fswatch-Xcf]command=fswatch-xiachufang. SH Directory=/users/piperck/desktop/tools/sa

Here's an app that says, [Program:project-name]

This is a fixed name. Here are some parameters of what the specific parameters can be selected to refer to the document.

So how do you start this conf file?

In fact, it is very simple, just need to edit the supervisord.conf configuration file we put in/etc under the line.

Look carefully at the configuration file content is not difficult to find, in the end there is a [include] module,

In this format below, you can let the start of the configuration file after the search for the path under the app to launch

=/USERS/PIPERCK/DESKTOP/TOOLS/SA/*. conf

Once configured, let's start him up and use the command directly

Supervisord can be started!

After that, it started. Nothing has happened. No side, this time use top or htop to see if the process has been started.

Remember to review the supervisor process and the process you started with your own commands, and you'll find that they're all alive! And it starts up, and when you close the process that was started by supervisor, he will also automatically restart you by default.

Remember there is another command not introduced, that is Supervisorctl

Name implies. is Supervisor's console.

Enter a control question and then use the Help command to easily see what commands are available.

Enter status here to see which apps are being launched by supervisor and which processes are started.

Reload can reload the modified configuration file.

In this way supervisor is started up, the effect is also very obvious, used to do what is also obvious, more parameters and advanced usage, or in practice to query the implementation of the document!

About the use and configuration of supervisor

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.