芹菜: [英] celery: "Substantial drift from"

查看:100
本文介绍了芹菜:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的分散系统中的芹菜有很大的问题.我在不同的地区有几台机器,并且在日志文件中有很多警告,例如:

I have quite a problem with celery on my distribted system. I have couple of machines among different localizations and I've got a lot of warnings in my log files like:

从celery @ host [...]大量漂移"

"Substantial drift from celery@host [...]"

我能够设置日期以返回相同的值(即使机器位于不同的国家/地区),但python print(utcoffset())在主服务器和节点上返回的结果也不同.

I was able to set date to return the same values (even that the machines are in different countries) but python print(utcoffset()) returns different results on main server and nodes.

如何解决该问题?除了utcoffset()应该返回相同的值外,我找不到任何好的解决方案-但是如何?

How to fix that issue? I was unable to find any good solution except that utcoffset() should return the same value - but how?

感谢您的帮助.

推荐答案

启动花时,我遇到了类似的问题:

I encountered a similar issue while starting flower:

[W 161208 08:42:00 state:74] Substantial drift from celery@host.com may mean clocks are out of sync.  Current drift is 10800 seconds.  [orig: 2016-12-08 08:42:00.722560 recv: 2016-12-08 05:42:00.719938]

使用的版本:

celery==3.1.23 (and 3.1.25)
flower==0.9.1
rabbitmq 3.5.6

具有设置:

CELERY_TIMEZONE='US/Pacific'
TIME_ZONE = 'US/Pacific'
USE_TZ = True

浏览了关于stackoverflow和git的所有可用问题报告和建议,但所有指示的修复程序,我都应该已经使用> 3.1.23

Looked through all available issue reports and suggestions on stackoverflow and git, but all indicated fixes that I should already have in place with > 3.1.23

这就是我的解决方法

我的系统和随后的bash环境在时区运行EST.如上所示,django应用程序运行美国/太平洋"(PST).这是3小时的差异,即10800秒.

My system and subsequent bash environment was running EST for timezone. As you can see above, the django app runs 'US/Pacific' (PST). This is is a 3 hour difference, or 10800 seconds.

通过将bash时区也设置为PST,以匹配django应用,漂移错误就消失了:

By setting the bash timezone to PST as well, to match the django app, the drift error went away:

export TZ="US/Pacific"

这篇关于芹菜:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆