热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

芹菜+Django:不能在Windows7上启动celerybeat。-Celery+Django:CannotstartcelerybeatonWindows7

Oddissuesoverhere.IvebeendevelopingaDjangoapplicationandIamnowtryingtoimplementCel

Odd issues over here. I've been developing a Django application and I am now trying to implement Celery. I need both normal tasks and periodic tasks to be queued. I can start up celeryd just fine, and execute tasks with it (I start it with the command python manage.py celeryd start --settings=settings --loglevel=INFO).

奇怪的问题在这里。我一直在开发Django应用程序,现在正在尝试实现芹菜。我需要正常的任务和周期性的任务来排队。我可以很好地启动celeryd,并使用它执行任务(我从命令python管理开始。py celeryd start—settings=settings—loglevel=INFO)。

On Windows you can't do -beat/-b to enable beat mode; you need to start celerybeat as a separate service (this is stated in the FAQ section of the Celery docs). If I type this into the command line -- python manage.py celerybeat -s djcelery.schedulers.DatabaseScheduler --settings=settings --loglevel=INFO -- I get an error like this:

在Windows上,你不能使用-beat/-b来启用beat模式;您需要将celerybeat作为一个单独的服务启动(这在芹菜文档的FAQ部分中有说明)。如果我将它输入到命令行——python管理。py celerybeat - s djcelery.schedulers。DatabaseScheduler—设置=设置—loglevel=INFO—我得到这样一个错误:

[2012-01-02 19:06:52,009: WARNING/MainProcess] ERROR: Pidfile (celerybeat.pid) a
lready exists.
Seems we're already running? (PID: 2364)
[2012-01-02 19:06:52,012: INFO/MainProcess] process shutting down

and celerybeat never actually starts. So I can't execute any periodic tasks ... Any ideas? I only found one other page where somebody highlighted a similar error, but no solution was offered.

而赛扬节奏从未真正开始过。所以我不能执行任何周期性的任务……什么好主意吗?我只找到了另一个页面,有人突出显示了类似的错误,但没有提供解决方案。

If there's any further information needed, please let me know. I'm baffled because I can't find any information on this subject, and I've been trying solve this problem all day today ... Thank you.

如果需要进一步的信息,请告诉我。我很困惑,因为我找不到关于这个问题的任何信息,我今天一整天都在试图解决这个问题……谢谢你!

2 个解决方案

#1


13  

Search your file system for that pid file and delete it. On unix machines that usually means the program was not shut down correctly. You should check to see if its running in the task manager already, if so kill it, and delete that file

在您的文件系统中搜索那个pid文件并删除它。在unix机器上,这通常意味着程序没有被正确地关闭。您应该检查它是否已经在任务管理器中运行,如果已经运行,请将其删除,并删除该文件

Then try again.

然后再试一次。

If there is no pid file present, that probably means there's an issue with the software as it was ported from unix perhaps?

如果没有pid文件,这可能意味着在从unix移植的软件中存在问题?

#2


5  

In my case of django project on Windows this file was already existing in root of the Django project. I deleted that file and the process ran without any error. enter image description here

对于Windows上的django项目,这个文件已经存在于django项目的根目录中。我删除了那个文件,进程运行没有任何错误。

The "celerybeat.pid" was already existing because I ran celery beat from another PC and pushed the git repo to the cloud. When I pulled the repo on my working PC and ran the process, it gave me error referring to the file "celerybeat.pid" created earlier by another PC. Deleting the "celerybeat.pid" made it work.

“celerybeat。“pid”已经存在了,因为我从另一台PC上运行了芹菜,并将git repo推到了云上。当我在工作的PC上拉出repo并运行这个过程时,它给了我指向“celerybeat”文件的错误。之前由另一台PC创建的pid。删除“celerybeat。pid”工作。


推荐阅读
author-avatar
手机用户2502872795
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有