gunicorn 服务器启动时出错

新手上路,请多包涵

在外部服务器上,我尝试运行命令:

 gunicorn --bind 0.0.0.0:8000 jeremiesblog.wsgi:application

我收到此错误:

 [2017-01-29 15:08:02 +0000] [19640] [INFO] Starting gunicorn 19.4.5
[2017-01-29 15:08:02 +0000] [19640] [ERROR] Connection in use: ('0.0.0.0', 8000)
[2017-01-29 15:08:02 +0000] [19640] [ERROR] Retrying in 1 second.
[2017-01-29 15:08:03 +0000] [19640] [ERROR] Connection in use: ('0.0.0.0', 8000)
[2017-01-29 15:08:03 +0000] [19640] [ERROR] Retrying in 1 second.
[2017-01-29 15:08:04 +0000] [19640] [ERROR] Connection in use: ('0.0.0.0', 8000)
[2017-01-29 15:08:04 +0000] [19640] [ERROR] Retrying in 1 second.
[2017-01-29 15:08:05 +0000] [19640] [ERROR] Connection in use: ('0.0.0.0', 8000)
[2017-01-29 15:08:05 +0000] [19640] [ERROR] Retrying in 1 second.
[2017-01-29 15:08:06 +0000] [19640] [ERROR] Connection in use: ('0.0.0.0', 8000)
[2017-01-29 15:08:06 +0000] [19640] [ERROR] Retrying in 1 second.
[2017-01-29 15:08:07 +0000] [19640] [ERROR] Can't connect to ('0.0.0.0', 8000)

我该怎么做才能解决这个问题?

原文由 user7388872 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 1k
2 个回答

错误信息:

使用中的连接:(‘0.0.0.0’, 8000)

表示端口正在使用中。您需要找到当前正在使用该端口的人并将其关闭。如果可以 sudo ,则可以使用 netstat 来查找谁已经在使用该端口:

 $ sudo netstat -nlp | grep :80
tcp  0  0  0.0.0.0:80  0.0.0.0:*  LISTEN  125004/gunicorn

在上面的示例中,它是 guincorn 的 pid 为 125004

来源

原文由 Stephen Rauch 发布,翻译遵循 CC BY-SA 3.0 许可协议

我得到了同样的错误,但我所做的就是从此命令中终止我的端口 8000。

 sudo fuser -k 8000/tcp

现在你可以运行命令

gunicorn --bind 0.0.0.0:8000 jeremiesblog.wsgi:application

原文由 imsaiful 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题