UWSGI 在 CentOS 上设置 nginx+django 服务时无法加载应用程序



centos7,python3.6.3,django1.11,uwsgi2.0.15当我运行命令"uwsgi--ini djcode_uwsgi.ini"时,没有加载任何应用程序,消息如下:

[uWSGI] getting INI configuration from djcode_uwsgi.ini
> open("/usr/lib64/uwsgi/python3_plugin.so"): No such file or directory
> [core/utils.c line 3686] !!! UNABLE to load uWSGI plugin:
> /usr/lib64/uwsgi/python3_plugin.so: cannot open shared object file: No
> such file or directory !!!
> *** Starting uWSGI 2.0.15 (64bit) on [Sat Oct  7 16:47:06 2017] *** compiled with version: 4.8.5 20150623 (Red Hat 4.8.5-11) on 19 May
> 2017 14:33:49 os: Linux-3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4
> 15:04:05 UTC 2017 nodename: izuf64a9gck8o1inxenp1cz machine: x86_64
> clock source: unix pcre jit disabled detected number of CPU cores: 1
> current working directory: /home/djcode detected binary path:
> /usr/sbin/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 /home/djcode your processes number limit is 3889 your memory page size is 4096 bytes detected max file descriptor number:
> 65535 lock engine: pthread robust mutexes thunder lock: disabled (you
> can enable it with --thunder-lock) uwsgi socket 0 bound to TCP address
> :8001 fd 3 your server socket listen backlog is limited to 100
> connections your mercy for graceful operations on workers is 60
> seconds mapped 363840 bytes (355 KB) for 4 cores
> *** Operational MODE: preforking ***
> *** no app loaded. going in full dynamic mode ***
> *** uWSGI is running in multiple interpreter mode *** spawned uWSGI master process (pid: 7787) spawned uWSGI worker 1 (pid: 7788, cores:
> 1) spawned uWSGI worker 2 (pid: 7789, cores: 1) spawned uWSGI worker 3
> (pid: 7790, cores: 1) spawned uWSGI worker 4 (pid: 7791, cores: 1)

django_uwsgi.ini中的设置:

#wsgi.ini file
[uwsgi]
plugin = python3
# Django-related settings
socket = :8001
callable = app
# the base directory (full path)
chdir           = /home/djcode
# Django s wsgi file
module          = djcode.wsgi
# process-related settings
# master
master          = true
# maximum number of worker processes
processes       = 4
# ... with appropriate permissions - may be needed
# chmod-socket    = 664
# clear environment on exit
vacuum          = true

我已经安装了uwsgi插件python。有什么建议吗?

我现在安装uwsgi-plugin-ython3,错误消息如下:

[uWSGI]从djcode_uWSGI.INI获取INI配置*于[2017年10月7日星期六18:07:27]启动uWSGI 2.0.15(64位)于5月19日编译版本:4.8.5 20150623(Red Hat 4.8.5-11)2017年14:33:49操作系统:Linux-3.10.0-514.26.2.el7.x86_64#1 SMP 7月4日星期二15:04:05 UTC 2017节点名:izuf64a9gck8o1inxenp1cz机器:x86_64时钟源:unix pcre jit已禁用检测到的CPU内核数:1当前工作目录:/home/djcode检测到二进制路径:/usr/sbin/uwsgi-uwsgi以root用户身份运行,您可以使用--uid/--gid/--chroot选项警告:您正在以root身份运行uWSGI!!!(使用--uid标志)chdir()到/home/djcode您的进程数限制为3889您的内存页面大小为4096字节检测到的最大文件描述符数:65535锁引擎:pthread健壮互斥thunder锁:禁用(您可以使用绑定到TCP地址的--thunder-lock)uwsgi套接字0启用它:8001 fd 3 Python版本:3.4.5(默认,2017年5月29日15:17:55)【GCC 4.8.5 20150623(Red Hat 4.8.5-11)】Python线程支持被禁用。您可以使用--enable threads来启用它Python主解释器初始化为0x12e9940您的服务器套接字侦听积压工作限制为100个连接对工人优雅操作的仁慈是60秒映射363840字节(355 KB),用于4个核心操作模式:预工作追溯(最后一次调用):文件"./djcode/init.py",第1行import pymysql ImportError:没有名为"pymysql"的模块无法加载应用程序0(mountpoint='')(找不到可调用或导入错误)未加载任何应用程序。进入全动态模式uWSGI在多解释器模式下运行*派生的uWSGI主进程(pid:8035)派生的uWSGI工作进程1(pid:8036,核心:1) 派生的uWSGI工作程序2(pid:8037,核心:1)派生的uWSGI工作程序3(pid:8038,内核:1)派生的uWSGI工作程序4(pid:8039,内核:2)

remove-plugin=python3:

[uWSGI]从djcode_uWSGI.INI获取INI配置*于[2017年10月7日星期六21:37:08]启动uWSGI 2.0.15(64位)于5月19日编译版本:4.8.5 20150623(Red Hat 4.8.5-11)2017年14:33:49操作系统:Linux-3.10.0-514.26.2.el7.x86_64#1 SMP 7月4日星期二15:04:05 UTC 2017节点名:izuf64a9gck8o1inxenp1cz机器:x86_64时钟源:unix pcre jit已禁用检测到的CPU内核数:1当前工作目录:/home/djcode检测到二进制路径:/usr/sbin/uwsgi-uwsgi以root用户身份运行,您可以使用--uid/--gid/--chroot选项警告:您正在以root身份运行uWSGI!!!(使用--uid标志)chdir()到/home/djcode您的进程数限制为3889您的内存页面大小为4096字节检测到的最大文件描述符数:65535锁引擎:pthread健壮互斥thunder锁:禁用(您可以使用绑定到TCP地址的--thunder-lock)uwsgi套接字0启用它:8001 fd 3您的服务器套接字侦听囤积限制为100关系你对工人优雅操作的仁慈是60秒映射363840字节(355 KB),用于4个核心操作模式:预工作未加载应用程序。进入全动态模式uWSGI在多解释器模式下运行*派生的uWSGI主进程(pid:8387)派生的uWSGI工作进程1(pid:88388,核心:1) 派生的uWSGI工作程序2(pid:8839,核心:1)派生的uWSGI工作程序3(pid:8390,核心:1)派生的uWSGI工作程序4(pid:8391,核心:一)

change callable=应用程序:

[uWSGI]从djcode_uWSGI.INI获取INI配置*于【2017年10月12日星期四15:42:00】启动uWSGI 2.0.15(64位)于5月19日编译版本:4.8.5 20150623(Red Hat 4.8.5-11)2017年14:33:49操作系统:Linux-3.10.0-514.26.2.el7.x86_64#1 SMP 7月4日星期二15:04:05 UTC 2017节点名:izuf64a9gck8o1inxenp1cz机器:x86_64时钟源:unix pcre jit已禁用检测到的CPU内核数:1当前工作目录:/home/djcode检测到二进制路径:/usr/sbin/uwsgi-uwsgi以root用户身份运行,您可以使用--uid/--gid/--chroot选项警告:您正在以root身份运行uWSGI!!!(使用--uid标志)chdir()到/home/djcode您的进程数限制为3889您的内存页面大小为4096字节检测到的最大文件描述符数:65535锁引擎:pthread健壮互斥thunder锁:禁用(您可以使用绑定到TCP地址的--thunder-lock)uwsgi套接字0启用它:8001 fd 3您的服务器套接字侦听囤积限制为100关系你对工人优雅操作的仁慈是60秒映射363840字节(355 KB),用于4个核心操作模式:预工作未加载应用程序。进入全动态模式uWSGI在多解释器模式下运行*派生的uWSGI主进程(pid:17756)派生的uWSGI工作进程1(pid:17757,核心:1) 派生的uWSGI工作程序2(pid:17758,核心:1)派生的uWSGI工作程序3(pid:17759,核心:1)生成了uWSGI工作程序4(pid:17760,核心:一)

我认为您安装了错误的软件包。

请尝试安装uwsgi-plugin-ython3。

相关内容

最新更新