【发布时间】:2015-09-03 15:18:14
【问题描述】:
我运行我的烧瓶应用程序,它运行良好,但是当应用程序停止并在我的 uwsgi 日志中时
probably another instance of uWSGI is running on the same address (127.0.0.1:9002).
bind(): Address already in use [core/socket.c line 764]
当我运行 touch touch_reload 时,应用程序再次运行。 我在服务器上运行任何其他可能占用套接字的东西。
我的会议:
nginx
server {
listen 80;
....
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:9001;
}
....
}
server {
listen 80;
....
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:9003;
}
....
}
uwsgi:
chdir = /var/www/../
module = wsgihandler
socket = 127.0.0.1:9003
wsgi-file = app/__init__.py
callable = app
master = true
chmod-socket = 664
uid = root
gid = root
processes = 4
socket-timeout = 180
post-buffering = 8192
max-requests = 1000
buffer-size = 32768
logto = /var/www/.../log/uwsgi.log
touch-reload = /var/www/.../touch_reload
【问题讨论】:
-
表示
9002端口已经在使用中。 -
你是如何停止进程的?
-
您可能必须使用 ctrl+z 来停止该过程,但这实际上只是隐藏它。使用 ctrl+c 完全停止
-
另外你可以使用 ps aux | grep 9002 查看 9002 用于什么
-
我没有停止服务器,它正在生产
标签: python sockets nginx flask uwsgi