pkg_resources.DistributionNotFound: The 'supervisor==3.4.0' distribution was not found and is required by the application

Sometimes the system is installed python3 and python2 , and python3 the default version, installation start supervisor when on the error.

 yum install supervisor

Edit the following 3 files and specify the python interpreter path at the beginning as version 2.

 vim /usr/bin/echo_supervisord_conf
vim /usr/bin/supervisorctl
vim /usr/bin/supervisord

start up

 systemctl start supervisord.service

Example

/etc/supervisord.d/demoQueue.ini

 [program:demo]
directory = /www/wwwroot/demo ;启动目录
command = php think queue:work --queue demoQueue --daemon ;启动命令
autostart = true ;在supervisord启动的时候也启动
startsecs = 5 ;启动5秒后没有异常退出,就当作已经正常启动了
autorestart = true ;程序异常退出后自动重启
startretries = 3 ;启动失败自动重试次数,默认是3
user = www ;哪个用户启动
redirect_stderr = true ;把stderr重定向到stdout,默认false
stdout_logfile_maxbytes = 20MB ;stdout日志文件大小,默认50MB
stdout_logfile_backups = 7 ;stdout日志文件备份数
stdout_logfile = /www/wwwroot/supervisor/demo/demoQueue.log ;stdout日志文件
 systemctl restart supervisord.service
supervisorctl star/stop demoQueue
supervisorctl status demoQueue
supervisorctl update #重启配置文件发生改动的程序
supervisorctl reread #载入新的配置文件
supervisorctl restart #重启某个应用
supervisorctl reload #重启 supervisor

big_cat
1.7k 声望130 粉丝

规范至上


引用和评论

0 条评论