Невозможно запустить рабочий процесс supervisord сельдерея в приложении эластичного бобового стебля django - PullRequest
0 голосов
/ 29 октября 2019

Я пытаюсь заставить ритм сельдерея бегать по джанго в среде эластичного бобового стебля. Я следовал советам по развертыванию здесь:

Как запустить работника сельдерея с приложением Django, масштабируемым с помощью AWS Elastic Beanstalk?

После развертывания процесс супервизора не удаетсяработай. Вот что показано в журналах:

-------------------------------------
/opt/python/log/supervisord.log
-------------------------------------
2019-10-28 19:58:35,321 CRIT Supervisor running as root (no user in config file)
2019-10-28 19:58:35,333 INFO RPC interface 'supervisor' initialized
2019-10-28 19:58:35,333 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2019-10-28 19:58:35,334 INFO supervisord started with pid 3034
2019-10-28 19:58:36,338 INFO spawned: 'httpd' with pid 3118
2019-10-28 19:58:37,805 INFO success: httpd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-10-28 19:59:37,279 INFO spawned: 'celeryd-beat' with pid 3543
2019-10-28 19:59:37,289 INFO spawned: 'celeryd-worker' with pid 3544
2019-10-28 19:59:38,023 INFO stopped: celeryd-beat (terminated by SIGTERM)
2019-10-28 19:59:38,325 INFO spawned: 'celeryd-beat' with pid 3552
2019-10-28 19:59:38,383 INFO exited: celeryd-worker (exit status 1; not expected)
2019-10-28 19:59:38,932 INFO exited: celeryd-beat (exit status 1; not expected)

Я не понимаю, что эти журналы говорят мне, и не смог пролить свет на это в результате моих собственных исследований.

Это сценарий оболочки, используемый для создания процесса:

#!/usr/bin/env bash

# Get django environment variables
celeryenv=`cat /opt/python/current/env | tr '\n' ',' | sed 's/export //g' | sed 's/$PATH/%(ENV_PATH)s/g' | sed 's/$PYTHONPATH//g' | sed 's/$LD_LIBRARY_PATH//g' | sed 's/%/%%/g'`
celeryenv=${celeryenv%?}

# Create celery configuraiton script
celeryconf="[program:celeryd-worker]
; Set full path to celery program if using virtualenv
command=/opt/python/run/venv/bin/celery worker -A app_name --loglevel=DEBUG

directory=/opt/python/current/app
user=nobody
numprocs=1
stdout_logfile=/var/log/celery-worker.log
stderr_logfile=/var/log/celery-worker.log
autostart=true
autorestart=true
startsecs=10

; Need to wait for currently executing tasks to finish at shutdown.
; Increase this if you have very long running tasks.
stopwaitsecs = 600

; When resorting to send SIGKILL to the program to terminate it
; send SIGKILL to its whole process group instead,
; taking care of its children as well.
killasgroup=true

; if rabbitmq is supervised, set its priority higher
; so it starts first
priority=998

environment=$celeryenv

[program:celeryd-beat]
; Set full path to celery program if using virtualenv
command=/opt/python/run/venv/bin/celery beat -A app_name --loglevel=DEBUG --workdir=/tmp -S django --pidfile /tmp/celerybeat.pid

directory=/opt/python/current/app
user=nobody
numprocs=1
stdout_logfile=/var/log/celery-beat.log
stderr_logfile=/var/log/celery-beat.log
autostart=true
autorestart=true
startsecs=10

; Need to wait for currently executing tasks to finish at shutdown.
; Increase this if you have very long running tasks.
stopwaitsecs = 600

; When resorting to send SIGKILL to the program to terminate it
; send SIGKILL to its whole process group instead,
; taking care of its children as well.
killasgroup=true

; if rabbitmq is supervised, set its priority higher
; so it starts first
priority=998

environment=$celeryenv"

# Create the celery supervisord conf script
echo "$celeryconf" | tee /opt/python/etc/celery.conf

# Add configuration script to supervisord conf (if not there already)
if ! grep -Fxq "[include]" /opt/python/etc/supervisord.conf
  then
  echo "[include]" | tee -a /opt/python/etc/supervisord.conf
  echo "files: celery.conf" | tee -a /opt/python/etc/supervisord.conf
fi

# Reread the supervisord config
supervisorctl -c /opt/python/etc/supervisord.conf reread

# Update supervisord in cache without restarting all services
supervisorctl -c /opt/python/etc/supervisord.conf update

# Start/Restart celeryd through supervisord
supervisorctl -c /opt/python/etc/supervisord.conf restart celeryd-beat
supervisorctl -c /opt/python/etc/supervisord.conf restart celeryd-worker

Может кто-нибудь заметить, что я сделал неправильно? Рады опубликовать больше кода, если это необходимо.

1 Ответ

0 голосов
/ 29 октября 2019

Это команды, которые решили это в конце:

sudo yum install -y libcurl-devel python-devel
PYTHON_INSTALL_LAYOUT=''
source /opt/python/run/venv/bin/activate && sudo /opt/python/run/venv/bin/python3.6 -m pip install pycurl --global-option="--with-openssl"
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...