[英]Error with gunicorn server start
在外部服务器上,我尝试运行以下命令:
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)
我能做些什么来解决这个问题?
错误信息:
使用中的连接:('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
。
(来源)
我遇到了同样的错误,但我所做的就是从这个命令中杀死我的端口 8000。
sudo fuser -k 8000/tcp
现在你可以运行命令
gunicorn --bind 0.0.0.0:8000 jeremiesblog.wsgi:application
这对我有用:
pgrep gunicorn
它会返回 pid,如下所示:
23716
23718
现在使用以下命令杀死其中任何一个(或全部):
kill 23716
如果它仍在运行,您可以使用pgrep gunicorn
重新检查。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.