- Installation
- Yum Install-y Python-setuptools
- Easy_install Supervisor
- echo_supervisord_conf >/etc/supervisord.conf Save the default configuration in/etc/supervisord.conf
- Configuration
- The Supervisord connection uses HTTP instead of a UNIX socket and sets the logon authentication information.
- Add the monitored program, the monitor program itself is non-background run
- Make configuration effective Kill-hup Supervisord_pid
- Places to be aware of
- If Autostart is set to True (the default) and the monitored process is running in singleton mode, restarting Supervisord,supervisord while the monitored process is running will keep trying to start the monitored process, resulting in wasted resources.
- The stdout and stderr outputs of the monitored process are saved in a separate temporary file by default and can be configured as needed. Supervisord These temporary files are cleared by default when they are started, and configuration nocleanup=true can be modified if desired. It is recommended that the output of the monitored process be manually redirected.
- Run
- Supervisord [-c/etc/supervisord.conf]
- Increased to boot boot
- Monitoring
- Operation via client command line
- Supervisorctl-s http://ip:port-u user-p passwd command
- Simple operation via web page
- Common commands
- Status [Nginxes:nginx]
- Reload/reread/shutdown
- Start/restart/stop <proc>
- Event monitoring and notification mechanism
- Supervisor sends the notification to the listeners and the child process or itself. For listeners,supervisor in the same pool, any available notification will be selected.
- Configuring
[program:x]
The Log capture Mode of the monitored process, the monitored process can output business data to stdout, which is captured by Supervisod and sent to listener.
- Configuring Event-listener: Monitoring Process_communication_stdout Events
- Envent-listener Module Development: Use Python's supervisor.childutils module. The module can be used as the Monitoring Agent module, and the process and the Network Management Service communication. and the network Management Service can be implemented using Redis's list.
- Xml-rpc API (to be perfected)
Supervisor Process Monitoring