Supervisor

项目代码一般在 /var/www/
项目日志一般在 /var/log/
用supervisor启动的项目,配置文件应该放在 /etc/supervisor/conf.d/ 。要在服务器上运行一个项目,把启动配置文件放在那个目录下,supervisor会自动管理。

supervisor自身日志位置:/var/log/supervisor/supervisord.log

 

在/etc/supervisor/conf.d目录下新建一个socweb的启动配置文件socweb_gov_ha.conf

重新加载supervisor,加载后默认会启动.conf配置文件里的内容

supervisorctl reload

也可以手动启动

supervisorctl restart socweb_ha
supervisorctl restart socweb_ha_celery
supervisorctl restart socweb_ha_discover

 

查看当前启动的supervisor任务:sudo supervisorctl ,执行完这个会进入supervisor命令行模式,可以与supervisor进行交互式操作,如下:

supervisor> status
supervisor> restart/start/stop/status socweb_ha socweb_ha_celery socweb_ha_discover

  

 

 

 

 

 

记录一次调错过程:

sudo supervisorctl update
cat /etc/supervisor/conf.d/socweb_ai.conf
cat supervisord.log

sudo systemctl status/start supervisor.service
sudo vi socweb_ai.conf


/var/www/socwebai/venv_socwebai/bin/celery -A app.celery.base worker -l info -n socwebai
sudo chown -R soc:soc socwebai/


which python3
which python


sudo supervisord -c socweb_ai.conf 

 

posted @ 2018-12-26 15:15  961897  阅读(305)  评论(0编辑  收藏  举报