admin管理员组文章数量:1640595
一、问题来源
使用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地址和端口后就解决了这一问题。
版权声明:本文标题:Django配置uwsgi时log文件报错thunder lock: disabled (you can enable it with --thunder-lock) 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dongtai/1729319946a1195759.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论