01, Introduction
02, installation and deployment
yum install python-setuptools
easy_install supervisor
03, instructions
After the successful installation supervisor, does not provide a default configuration file can be generated by running the initial configuration file echo_supervisord_conf program supervisor of mkdir / etc / supervisor echo_supervisord_conf > /etc/supervisor/supervisord.conf
04, the configuration file description
[unix_http_server] File = / tmp / supervisor.sock; the UNIX Socket file, supervisorctl use ; the chmod = 0700 ; MODE Socket file, the default is 0700 ; chown = the nobody: nogroup; owner Socket file format: UID: GID [ inet_http_server]; HTTP server to provide web management interface port = 192.168 . 1.10 : 9001 ; Web management background IP and port, if open to the public, need to pay attention to safety ; username = the user; login management background username ; password = 123 ; login password management background [supervisord] logfile = / tmp / supervisord. log; Log file, default $ CWD / supervisord. Log logfile_maxbytes = 50MB; log file size would exceed Rotate, 50MB default, if set to 0, not to limit the size logfile_backups = 10 ; number of log files to keep the backup default 10, to 0 means no backup the LogLevel = info; log level, the default info, other: Debug, the warn , the trace the PidFile . = / tmp / supervisord pid; pid file nodaemon = false; whether to start in the foreground, the default is false, that is daemon way start minfds = 10240 ; minimum file descriptors that can be opened, the default 1024 minprocs = 200 ; the minimum number of processes that can be opened, the default 200 [supervisorctl] ; ServerURL = UNIX:. /// tmp / Supervisor our sock; supervisord connected via UNIX socket, consistent unix_http_server file path portion ServerURL = HTTP: // 192.168 . 1.10 : 9001 ; supervisord connected by way of HTTP ; [ program : XX] is managed process configuration parameters, xx is the name of the process [program : XX] command = / opt / Apache-tomcat- 8.0 . 35 / bin / Catalina. SH RUN; program start command autostart = to true; in supervisord start automatically when starting startsecs = 10 ; no quit unexpectedly after starting 10 seconds, it means that the process starts normally, the default is 1 second autorestart= true; automatically restart after the program exits, optional value: [unexpected, to true, false], the default is unexpected, means the process after an accident killed restart startretries = 3 ; failed to start automatically retries, the default is 3 the User = Tomcat ; start the process with which the user, the default is the root priority = 999 ; priority process starts, the default 999, the value of a small boot priority redirect_stderr is = to true; redirect stderr to stdout, default false stdout_logfile_maxbytes = 20MB; stdout log file size, default 50MB stdout_logfile_backups = 20 ; stdout log file backup number, the default is 10 ; stdout log file, you need to pay attention to when not start properly when the specified directory does not exist, it is necessary to create the directory manually (supervisord automatically creates a log file) stdout_logfile = / opt / the Apache -tomcat- 8.0 . 35/ logs / catalina. OUT stopasgroup = false; the default is false, when the process is killed, whether to send a signal to stop this process group, including sub-processes killasgroup = false; the default is false, send a kill signal to the process group, including sub-processes ; include other profiles [the include] files = /etc/supervisor/config.d/*.ini; can specify one or more of the. INI end profile ; files = /opt/absolute/filename.ini / opt / . absolute / * ini foo.conf config ?? ini;. include exemplary
Interactive 05, docker's
[program:asr] command=/usr/bin/nohup /TcAsr/DPService & stdout_logfile=file.log autostart=true autorestart=true startsecs=5 priority=1 stopasgroup=true killasgroup=true 应用于制作docker EXPOSE 22 80 CMD ["/usr/bin/supervisord"]