inflearn logo
강의

Khóa học

Chia sẻ kiến thức

Celery cùng kỹ sư Thung lũng Silicon

Giải quyết lỗi Task bằng Signal

product level에서 celeryd를 사용하시나요?

239

bluebamus

84 câu hỏi đã được viết

0

명령어가 아닌, docker 컨테이너에서 데몬으로 만들어 사용해 보려고 celeryd를

https://celery-safwan.readthedocs.io/en/latest/userguide/daemonizing.html

위 레퍼런스를 따라 설정을 해보았는데 이틀동안 작업을 해보았지만, 결코 celery가 작업을 가져가지 않더라고요.

혹시 사용해 보신적이 있다면 제가 사용한 설정 내용에서 오류가 있는지 확인을 부탁드려도 될까요?

# Names of nodes to start
#   most people will only start one node:
CELERYD_NODES="worker1"
#   but you can also start multiple and configure settings
#   for each in CELERYD_OPTS
#CELERYD_NODES="worker1 worker2 worker3"
#   alternatively, you can specify the number of nodes to start:
#CELERYD_NODES=10

# Absolute or relative path to the 'celery' command:
CELERY_BIN="/usr/local/bin/celery"
#CELERY_BIN="/virtualenvs/def/bin/celery"

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

# Name of the projects settings module.
export DJANGO_SETTINGS_MODULE="config.settings.dev"

# Where to chdir at start.
CELERYD_CHDIR="/www/test-project"
CELERYBEAT_CHDIR="/www/test-project"

# Extra command-line arguments to the worker
CELERYD_OPTS="--time-limit=300 --concurrency=2"
# Configure node-specific settings by appending node name to arguments:
#CELERYD_OPTS="--time-limit=300 -c 8 -c:worker2 4 -c:worker3 2 -Ofair:worker1"

# Set logging level to DEBUG
#CELERYD_LOG_LEVEL="DEBUG"

# Name of the celery config module.
# CELERY_CONFIG_MODULE="config.celery"

CELERYD_LOG_LEVEL="INFO"

# %n will be replaced with the nodename.
CELERYD_LOG_FILE="/log/gunicorn/celery/celery-%n%I.log"
CELERYD_PID_FILE="/log/gunicorn/celery/celery-run-%n.pid"
CELERYBEAT_LOG_FILE="/log/gunicorn/celerybeat/celerybeat.log"
CELERYBEAT_PID_FILE="/log/gunicorn/celerybeat/celerybeat-run.pid"

# Workers should run as an unprivileged user.
CELERYD_USER="root"
CELERYD_GROUP="root"

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

django celery django-celery django-celery-beat

Câu trả lời 1

0

altoformula

안녕하세요 bluebamus님,

Production에서는 저는 이런식으로 사용하지 않고, https://github.com/dimz119/learn-celery/blob/main/django_celery/docker-compose.yml#L80 여기처럼 커맨드를 k8s command에서 돌려서 사용하거나, Supervisord를 사용해서 Docker안에서 돌리고 있습니다만, 각자만의 방식이 있고, 워낙 전체적으로 에러를 보면서 해야되기 때문에 제가 딱히 도움을 드릴 수가 없네요.

1

bluebamus

감사합니다. Production 보다는 공식 문서에 제공되는 정보라 학습을 하면서 해결이 안되던 부분이었습니다. 말씀대로 Production에서는 커멘드를 사용하는게 맞다고 생각 합니다. ^^

진도미확인 (진도가 안 넘어감)

0

41

1

자료 화면 문의

0

40

1

celery.py 위치

0

96

2

docker-compose

0

113

1

standalone_celery 에만 작성된 task 들은 호출할 수 없나요?

0

136

2

수업노트 github 주소가 404가 많아요

0

92

1

celery의 로그 설정을 django의 settings.py에서 따로 해줘야 하는게 있을까요?

1

346

1

django에서 view나 api에서 request를 celery로 넘길 수 있을까요?

1

246

1

child process에 lock/좀비 프로세스가 발생하면 어떻게 처리되나요?

1

251

1

DLQ와 관련한 이전 질문의 추가 질문 입니다.

1

272

2

task 에러를 signal로 잡는 부분에 대해 질문 드립니다.

0

215

1

DLQ에 저장하는 패턴에 대해 질문 드립니다.

1

204

1

DLX에 대한 질문입니다.

1

153

1

기존 docker-compose는 admin의 깨져서 나옵니다.

1

207

2

실습에 문제가 많아 수업노트보기의 저장소 코드를 확인해봤습니다.

1

221

2

celery-standalone에 대한 질문입니다.

1

165

1

Celery Monitoring Tool, Flower에 대해 알아보기에 질문 있습니다.

1

529

3

group에서 keyword arg를 전송할 때에 대해 알고 싶습니다.

1

208

1

SNS 처럼 사용하기

1

177

1

셀러리 사용에 문의드립니다.

1

288

2

Task Routing 부분 보니까요

1

316

1

celery 에서 task 작업 끝난 후 ack 받기

1

374

2

rate_limit

0

321

2

docker-compose

2

451

2