admin管理员组

文章数量:1640627

一、问题来源

    使用uwsgi --ini mysite.ini命令启动后使用ps -aux | grep uwsgi命令查询uwsgi的相关进程,但是查询不到,发现只有下面一个进程,说明uwsgi启动ini文件失败。

root      201642  0.0  0.0   9032   728 pts/0    S+   12:16   0:00 grep --color=auto uwsgi

    后面,通过vim打开log文件查询是否有报错,发现下面这种错误,报错信息是thunder lock: disabled (you can enable it with --thunder-lock)
bind(): Permission denied [core/socket.c line 769]。

our processes number limit is 31045
your memory page size is 4096 bytes
 *** WARNING: you have enabled harakiri without post buffering. Slow upload could be rejected on post-unbuffered webservers ***
detected max file descriptor number: 65535
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
bind(): Permission denied [core/socket.c line 769]

二、解决方案

    通过查阅相关资料,我先尝试了下面两种方法。
    1. 使用root权限:即sudo uwsgi --ini mysite.ini
    2. 在mysite.ini文件中更改socket参数的目录为tmp,即socket = /tmp/mysite.sock
    第二种方法可以解决我的问题,但是后面发现这不是真正的原因。
    实际上,我发现我的报错是由于mysite.ini中配置的socket与nginx中mysite.conf文件uwsgi_pass配置的IP地址与端口不一样造成的,将mysite.ini中的socket与/etc/nginx中mysite.conf文件的uwsgi_pass设置为相同的IP地址和端口后就解决了这一问题。

本文标签: 报错文件uwsgilogdjango