两天了,泪崩, uWSGI 启不来! 求大佬看看

2022-04-15 19:02:51 +08:00
 maloneleo88

日志

*** Starting uWSGI 2.0.18 (64bit) on [Fri Apr 15 18:52:46 2022] ***
compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-44) on 15 April 2022 10:16:59
os: Linux-3.10.0-1160.49.1.el7.x86_64 #1 SMP Tue Nov 30 15:51:32 UTC 2021
nodename: VM-16-9-centos
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 2
current working directory: /www/wwwroot/zrhd_bj
writing pidfile to uwsgi.pid
detected binary path: /usr/local/bin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 
chdir() to /www/wwwroot/zrhd_bj/
your processes number limit is 7265
your memory page size is 4096 bytes
detected max file descriptor number: 100001
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
probably another instance of uWSGI is running on the same address (127.0.0.1:8000).
bind(): Address already in use [core/socket.c line 769]

运行没提示错误 [uWSGI] getting INI configuration from uwsgi.ini

进程就一个 root 5590 0.0 0.0 112812 980 pts/0 S+ 18:59 0:00 grep --color=auto uWSGI

访问就 503

求解

3930 次点击
所在节点    Python
13 条回复
l4ever
2022-04-15 19:04:35 +08:00
probably another instance of uWSGI is running on the same address (127.0.0.1:8000).
bind(): Address already in use [core/socket.c line 769]
hsfzxjy
2022-04-15 19:06:59 +08:00
你要 grep uwsgi 吧
snBDX1b0jJM4ogKd
2022-04-15 19:14:48 +08:00
lsof -i :8000
maloneleo88
2022-04-15 19:25:03 +08:00
新日志
```
*** Starting uWSGI 2.0.18 (64bit) on [Fri Apr 15 19:23:50 2022] ***
compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-44) on 15 April 2022 10:16:59
os: Linux-3.10.0-1160.49.1.el7.x86_64 #1 SMP Tue Nov 30 15:51:32 UTC 2021
nodename: VM-16-9-centos
machine: x86_64
clock source: unix
pcre jit disabled
detected number of CPU cores: 2
current working directory: /www/wwwroot/zrhd_bj
writing pidfile to uwsgi.pid
detected binary path: /usr/local/bin/uwsgi
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
chdir() to /www/wwwroot/zrhd_bj/
your processes number limit is 7265
your memory page size is 4096 bytes
detected max file descriptor number: 100001
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uWSGI http bound on 127.0.0.1:8000 fd 4
uwsgi socket 0 bound to TCP address 127.0.0.1:37372 (port auto-assigned) fd 3
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
Python version: 3.8.10 (default, Apr 15 2022, 15:06:15) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
Python main interpreter initialized at 0x1fafb10
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 166752 bytes (162 KB) for 2 cores
*** Operational MODE: threaded ***
failed to open python file /zrhd_bj/wsgi.py
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 2115)
spawned uWSGI worker 1 (pid: 2116, cores: 2)
spawned uWSGI http 1 (pid: 2117)
```
among
2022-04-15 19:33:53 +08:00
failed to open python file /zrhd_bj/wsgi.py
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
maloneleo88
2022-04-15 19:38:59 +08:00
@among

wsgi

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'zrhd_bj.settings')

application = get_wsgi_application()

默认的 没动过呀
SenLief
2022-04-15 19:40:51 +08:00
这不是提示 8000 端口被占用了吗?换个口试试。
sujin190
2022-04-15 19:43:30 +08:00
这么明显的错误了吧,要么配置文件目录写错了,要么执行目录弄错了,这个运行方式、启动命令、配置文件都不发没人知道你哪写错了
cz5424
2022-04-15 20:03:12 +08:00
端口占用
zeusho871
2022-04-16 05:38:57 +08:00
都用 uwsgi 了,试试用 unix socket ?
Quarter
2022-04-16 07:52:36 +08:00
你这个进程就是你的 grep 啊😅
elboble
2022-04-16 16:42:18 +08:00
是不是 apt 或者 yum 装的 uwsgi ?
建议删了用 pip install 安装
maloneleo88
2022-04-16 22:28:22 +08:00
@elboble
@Quarter
@zeusho871

谢谢大家,好了。 就是 uwsgi 单独启动的时候 ip 填 127 启不来 换 4 个 0 就好了, 搭配 nginx 时候再换 127 坑爹玩意

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

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

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

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

© 2021 V2EX