- 首先要编辑配置文件
注意:此处文件中的“./”均为相对路径的本文件夹,只能本下启动,且需要在本文件夹下创建log文件夹
log[unix_http_server]file=/tmp/supervisor.sock ; the path to the socket file[inet_http_server] ; inet (TCP) server disabled by defaultport=0.0.0.0:9001 ; ip_address:port specifier, *:port for all iface[supervisord]logfile=./log/supervisord.log ; main log file; default $CWD/supervisord.loglogfile_maxbytes=50MB ; max main logfile bytes b4 rotation; default 50MBlogfile_backups=10 ; # of main logfile backups; 0 means none, default 10loglevel=info ; log level; default info; others: debug,warn,tracepidfile=./log/supervisord.pid ; supervisord pidfile; default supervisord.pidminfds=1024 ; min. avail startup file descriptors; default 1024minprocs=200 ; min. avail process descriptors;default 200[rpcinterface:supervisor]supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface[supervisorctl]serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socketserverurl=http://0.0.0.0:9001 ; use an http:// url to specify an inet socket[program:main_server]command=gunicorn -w 1 -b 0.0.0.0:5000 app:app ; the program (relative uses PATH, can take args)stopsignal=QUIT ; signal used to kill process (default TERM)stopasgroup=false ; send stop signal to the UNIX process group (default false)killasgroup=false ; SIGKILL the UNIX process group (def false)stdout_logfile=./log/main_server_out ; stdout log path, NONE for none; default AUTOstdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)stderr_logfile=./log/main_server_error ; stderr log path, NONE for none; default AUTOstderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)[program:redis]command=redis-server
