Celery和Celerybeat正在运行,但不运行任务

问题描述 投票:0回答:1

我已经在本地服务器上检查了我的代码,我确信我的代码一切正常。所以服务器配置似乎有问题。我有一个Linux服务器(Ubuntu 16.04)并安装了nginx,redis,...我还为celery和celerybeat创建了配置文件,如下所示:

  • /etc/init.的/celery的
  • 在/ etc /默认/ celeryd
  • /etc/init.的/celery beat
  • 在/ etc /默认/ celerybeat

我检查了他们的状态,他们都在运行,但是当我检查beat.log时它没有做任何事情只显示'开始......'

芹菜文件:

# Names of nodes to start
CELERYD_NODES="worker"

# Absolute or relative path to the 'celery' command:
CELERY_BIN="/home/amirali/AwesomeApp/awesome_env/bin/celery"


# App instance to use
CELERY_APP="AwesomeApp"


# Where to chdir at start. Where your manage.py is...
CELERYD_CHDIR="/home/amirali/AwesomeApp"

# Extra command-line arguments to the worker
CELERYD_OPTS="--time-limit=300 -Ofair --concurrency=8"

# Set logging level to DEBUG
CELERYD_LOG_LEVEL="INFO"

# %n will be replaced with the first part of the nodename.
CELERYD_LOG_FILE="/var/log/celery/%n%I.log"
CELERYD_PID_FILE="/var/run/celery/%n.pid"

# Workers should run as an unprivileged user.
#   You need to create this user manually (or you can choose
#   a user/group combination that already exists (e.g., nobody).
CELERYD_USER="celery"
CELERYD_GROUP="celery"

# If enabled pid and log directories will be created if missing,
# and owned by the userid/group configured.
CELERY_CREATE_DIRS=1

celerybeat文件:

  File: /etc/default/celerybeat                                                                                                                                                              
  CELERYBEAT_LOG_LEVEL="info"
  # Absolute or relative path to the 'celery' command:
  CELERY_BIN="/home/amirali/AwesomeApp/awesome_env/bin/celery"

  CELERYBEAT_USER="celery"
  CELERYBEAT_GROUP="celery"
  # App instance to use
  # comment out this line if you don't use an app
  CELERY_APP="AwesomeApp"
  # or fully qualified:
  #CELERY_APP="proj.tasks:app"

  # Where to chdir at start.
  CELERYBEAT_CHDIR="/home/amirali/AwesomeApp"

  # Extra arguments to celerybeat
  CELERYBEAT_OPTS="--schedule=/var/run/celery/celerybeat-schedule"
  export DJANGO_SETTINGS_MODULE="AwesomeApp.settings"
django nginx redis celery celerybeat
1个回答
0
投票

当我们必须执行芹菜周期性任务时,结果表明celery-beat无法正常工作,它只是在某个时刻停止了发射任务。

经过一些测试,我们决定不再浪费时间在它上面并依赖linux crontab实用程序

热门问题
推荐问题
最新问题