supervisor安装和自启动的一些问题
展开全部
1、网上说: pip install supervisor
出现问题: bash:pip:command not found
需要安装pip: sudo easy_install pip
出现问题: sudo: easy_install: command not found
需要执行: sudo apt-get install python-setuptools
然后就可以: pip install supervisor
2、在supervisor默认配置中,其启动的sock等都会放到tmp目录,而tmp目录会自动清理(比如重启主机)导致无法使用supervisorctl命令;
修改supervisor.conf文件,修改到/var/run/及/var/log/目录
file=/var/run/supervisor.sock
serverurl=unix:///var/run/supervisor.sock ; 等等
*注意:修改supervisor.conf文件后,要执行 supervisorctl reload ,重新加载配置文件;
*注意:supervisor好像需要root安装;
3、错误:Supervisorctl error: unix:///var/run/supervisord.sock refused connection?
说明需要开启supervisord。
echo_supervisord_conf > /etc/supervisord.conf //如果已经修改了supervisor.conf,这句就不要执行了
sudo supervisord -c /etc/supervisord.conf
sudo supervisorctl status
4、supervisor自启动
其实自启动,也就是在主机开启的时候,执行了 sudo supervisord -c /etc/supervisord.conf ;
创建 /usr/lib/systemd/system/supervisord.service 文件;
写入:
# dservice for systemd (CentOS 7.0+)
# by ET-CS ( https://github.com/ET-CS )
[Unit]
Description=Supervisor daemon
[Service]
Type=forking
ExecStart=/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
ExecStop=/usr/bin/supervisorctl shutdown
ExecReload=/usr/bin/supervisorctl reload
KillMode=process
Restart=on-failure
RestartSec=42s
[Install]
WantedBy=multi-user.target
*注意:我的supervisord的目录是/usr/local/bin/supervisord,需要把上边目录修改;
将文件拷贝至:“/usr/lib/systemd/system/supervisord.service”
systemctl enable supervisord
Error: Another program is already listening on a port that one of our HTTP servers is configured to use. Shut this program down first before starting
解决方法:
find / -name supervisor.sock
unlink /name/supervisor.sock
unix:///var/run/supervisor.sock no such file
sudo touch /var/run/supervisor.sock
sudo chmod 777 /var/run/supervisor.sock
sudo service supervisor restart
原博客地址: http://www.cnblogs.com/94cool/p/5952219.html
出现问题: bash:pip:command not found
需要安装pip: sudo easy_install pip
出现问题: sudo: easy_install: command not found
需要执行: sudo apt-get install python-setuptools
然后就可以: pip install supervisor
2、在supervisor默认配置中,其启动的sock等都会放到tmp目录,而tmp目录会自动清理(比如重启主机)导致无法使用supervisorctl命令;
修改supervisor.conf文件,修改到/var/run/及/var/log/目录
file=/var/run/supervisor.sock
serverurl=unix:///var/run/supervisor.sock ; 等等
*注意:修改supervisor.conf文件后,要执行 supervisorctl reload ,重新加载配置文件;
*注意:supervisor好像需要root安装;
3、错误:Supervisorctl error: unix:///var/run/supervisord.sock refused connection?
说明需要开启supervisord。
echo_supervisord_conf > /etc/supervisord.conf //如果已经修改了supervisor.conf,这句就不要执行了
sudo supervisord -c /etc/supervisord.conf
sudo supervisorctl status
4、supervisor自启动
其实自启动,也就是在主机开启的时候,执行了 sudo supervisord -c /etc/supervisord.conf ;
创建 /usr/lib/systemd/system/supervisord.service 文件;
写入:
# dservice for systemd (CentOS 7.0+)
# by ET-CS ( https://github.com/ET-CS )
[Unit]
Description=Supervisor daemon
[Service]
Type=forking
ExecStart=/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
ExecStop=/usr/bin/supervisorctl shutdown
ExecReload=/usr/bin/supervisorctl reload
KillMode=process
Restart=on-failure
RestartSec=42s
[Install]
WantedBy=multi-user.target
*注意:我的supervisord的目录是/usr/local/bin/supervisord,需要把上边目录修改;
将文件拷贝至:“/usr/lib/systemd/system/supervisord.service”
systemctl enable supervisord
Error: Another program is already listening on a port that one of our HTTP servers is configured to use. Shut this program down first before starting
解决方法:
find / -name supervisor.sock
unlink /name/supervisor.sock
unix:///var/run/supervisor.sock no such file
sudo touch /var/run/supervisor.sock
sudo chmod 777 /var/run/supervisor.sock
sudo service supervisor restart
原博客地址: http://www.cnblogs.com/94cool/p/5952219.html
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
Storm代理
2023-07-25 广告
2023-07-25 广告
StormProxies是一家可靠的代理服务提供商,提供原生IP(住宅原生IP)和高匿名代理服务。以下是关于StormProxies的原生IP服务的一些信息:1. 住宅原生IP:StormProxies提供的住宅原生IP是指从真实的家庭或企...
点击进入详情页
本回答由Storm代理提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询