V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
zxxyolanda
V2EX  ›  Flask

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

  •  
  •   zxxyolanda · 2017-05-12 18:13:24 +08:00 · 5557 次点击
    这是一个创建于 2758 天前的主题,其中的信息可能已经有所发展或是发生改变。

    部署 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
    
    

    求助,怎么解

    14 条回复    2017-05-13 14:26:48 +08:00
    guoweikuang
        1
    guoweikuang  
       2017-05-12 18:17:32 +08:00 via Android
    supervisor 不支持 Python3 吧
    shuirong1997
        2
    shuirong1997  
       2017-05-12 18:18:23 +08:00 via Android
    Shut this program down first before starting supervisord
    cxbats
        3
    cxbats  
       2017-05-12 18:21:17 +08:00 via Android
    看看哪个程序占用了端口
    tuteng
        4
    tuteng  
       2017-05-12 18:28:43 +08:00
    端口被占用了
    qweweretrt515
        5
    qweweretrt515  
       2017-05-12 20:48:40 +08:00
    建议你用 docker 来部署
    mxi1
        6
    mxi1  
       2017-05-12 20:56:56 +08:00 via iPhone
    是不是 apache/nginx 跑着,然后你又把 80 端口设置成 flask app 的端口了?
    wwqgtxx
        7
    wwqgtxx  
       2017-05-12 21:10:52 +08:00
    其实如果是 Ubuntu16.04 的话,直接用 systemd 就行了,没必要套 supervisor
    Kilerd
        8
    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
        9
    xiaozizayang  
       2017-05-12 21:14:21 +08:00
    首先 ps -aux |grep 把占用的端口找出来,然后 supervisor 不要直接运行代码,比如用 Gunicorn 来管理,然后用 supervisor 管理 Gunicorn。
    jjww
        10
    jjww  
       2017-05-12 21:24:29 +08:00
    try:

    unlink /var/run/supervisor.sock
    Wichna
        11
    Wichna  
       2017-05-12 22:03:35 +08:00
    我也记得 supervisor 不支持 python3
    pynix
        12
    pynix  
       2017-05-12 23:13:55 +08:00
    我就奇了怪了,这么明显的错误信息。。。。。
    julyclyde
        13
    julyclyde  
       2017-05-12 23:38:53 +08:00
    这么明显的错误信息,上面还有一堆跑题的
    fox0001
        14
    fox0001  
       2017-05-13 14:26:48 +08:00 via Android
    这么明显的端口被占用…都散了,没什么好说的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3164 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 20ms · UTC 00:13 · PVG 08:13 · LAX 16:13 · JFK 19:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.