简体   繁体   English

Django Digital Ocean Gunicorn日志文件创建502

[英]django digital ocean gunicorn logfiles creating a 502

I am going nuts here, I am trying to get django logging to work, which led me to need to check the gunicorn logs which I found were not setup and when i try to set them up via the config file it throws a 502 and I don't know how to track it down... 我在这里疯了,我试图让Django日志正常工作,这导致我需要检查未发现设置的gunicorn日志,当我尝试通过配置文件进行设置时会抛出502,而我不知道如何追踪...

according to this... https://www.digitalocean.com/community/tutorials/how-to-use-the-django-one-click-install-image 根据此... https://www.digitalocean.com/community/tutorials/how-to-use-the-django-one-click-install-image

the config file on the DO deployment is at... /etc/gunicorn.d/gunicorn.py DO部署上的配置文件位于... /etc/gunicorn.d/gunicorn.py

now when I go to that file and add a line like this as per the gunicorn docs tell me to do in the config file, and then I restart gunicorn it throws a 502 at me... 现在,当我转到该文件并按照gunicorn文档告诉我在配置文件中添加一行时,然后重新启动gunicorn,它向我抛出502 ...

"""gunicorn WSGI server configuration.""" from multiprocessing import cpu_count from os import environ “”“ gunicorn WSGI服务器配置。”“”来自os导入环境的多处理导入cpu_count

def max_workers():
    return cpu_count() * 2 + 1

max_requests = 1000
worker_class = 'gevent'
workers = max_workers()
#my added config
errorlog = '/var/log/gunicorn/error.log'

Interesting to note is that when I srestart gunicorn with 有趣的是,当我用

sudo service gunicorn restart

it goes smoothly the first time and then if I try to restart it again it gives me this... 它第一次运行顺利,然后如果我尝试重新启动它,它给了我这个...

stop: Unknown instance: 
gunicorn start/running, process 30943

I have tried contacting digital ocean about this and so far they have not been helpful, any ideas of where to go next? 我曾尝试就此与数字海洋联系,到目前为止,他们对您没有帮助,对下一步的想法有何帮助?

This was cause by the permissions of the log files for some reason. 这是由于某些原因而导致的日志文件权限引起的。 Through some more testing I have found that the log files need to be already in place, and their permissions need to be set to no less than 666. 通过更多测试,我发现日志文件必须已经存在,并且其权限需要设置为不少于666。

I have no idea why they need to be this high... 我不知道为什么他们需要这么高...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在数字海洋上部署Django,Gunicorn,Nginx,Virtualenv给了我502 Bad Gateway&Gunicorn无法读取密钥 - Deploying Django, Gunicorn, Nginx, Virtualenv on Digital ocean gives me 502 Bad Gateway & Gunicorn can't read Secret Key 将Django应用程序部署到Digital Ocean-Gunicorn错误 - Deploy a Django Application to Digital Ocean - Gunicorn Error Django:未使用python venv的Digital Ocean django图像gunicorn - Django: Digital Ocean django image gunicorn not using python venv 将 django 应用程序部署到数字海洋失败(502 Bad Gateway) - Deploying django app to digital ocean unsuccessful (502 Bad Gateway) 无法在数字海洋飞沫上使用Django和Nginx(Gunicorn)发送电子邮件 - Cannot send email using django and nginx(gunicorn) on digital ocean droplet 数字海洋NGINX和Gunicorn上的CORS标头访问控制缺少Django - CORS header access control missing django on digital ocean NGINX and gunicorn Django在Digital Ocean上 - Django on Digital Ocean 将 cookiecutter-django 和 gunicorn 部署到数字海洋的 Production.py 问题 - Production.py issue with deployment of cookiecutter-django and gunicorn to digital ocean Django,django oscar和Digital Ocean - Django, django oscar & Digital Ocean 数字海洋和 Django 的操作错误 - operational error with Digital ocean and django
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM