Flask 部署, Supervisor 报错怎么解决?求助

2017-05-12 18:13:24 +08:00
 zxxyolanda

部署 Flask 环境 Ubuntu python3

添加 Supervisor 总报错,如下:

➜  lan supervisord
/usr/lib/python2.7/dist-packages/supervisor/options.py:297: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security.
  'Supervisord is running as root and it is searching '
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 supervisord.
For help, use /usr/bin/supervisord -h

求助,怎么解

5381 次点击
所在节点    Flask
14 条回复
guoweikuang
2017-05-12 18:17:32 +08:00
supervisor 不支持 Python3 吧
shuirong1997
2017-05-12 18:18:23 +08:00
Shut this program down first before starting supervisord
cxbats
2017-05-12 18:21:17 +08:00
看看哪个程序占用了端口
tuteng
2017-05-12 18:28:43 +08:00
端口被占用了
qweweretrt515
2017-05-12 20:48:40 +08:00
建议你用 docker 来部署
mxi1
2017-05-12 20:56:56 +08:00
是不是 apache/nginx 跑着,然后你又把 80 端口设置成 flask app 的端口了?
wwqgtxx
2017-05-12 21:10:52 +08:00
其实如果是 Ubuntu16.04 的话,直接用 systemd 就行了,没必要套 supervisor
Kilerd
2017-05-12 21:14:06 +08:00
Another program is already listening on a port that one of our HTTP servers is configured to use
xiaozizayang
2017-05-12 21:14:21 +08:00
首先 ps -aux |grep 把占用的端口找出来,然后 supervisor 不要直接运行代码,比如用 Gunicorn 来管理,然后用 supervisor 管理 Gunicorn。
jjww
2017-05-12 21:24:29 +08:00
try:

unlink /var/run/supervisor.sock
Wichna
2017-05-12 22:03:35 +08:00
我也记得 supervisor 不支持 python3
pynix
2017-05-12 23:13:55 +08:00
我就奇了怪了,这么明显的错误信息。。。。。
julyclyde
2017-05-12 23:38:53 +08:00
这么明显的错误信息,上面还有一堆跑题的
fox0001
2017-05-13 14:26:48 +08:00
这么明显的端口被占用…都散了,没什么好说的

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/360934

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX