1. EDX production celery_beat configuration:
cd /edx/app/supervisor/conf. available.d
-------===================================================================================================
2. EDX production celery_async configuration:
sudo chown www-data:www-data celery_async_worker.conf
Its content :
cd /edx/app/supervisor/conf.
sudo nano celery_beat_worker.conf
Its content:
____________________________
[program:celery_beat_worker]
directory=/edx/app/edxapp/edx- platform
environment=DJANGO_SETTINGS_ MODULE=lms.envs.aws,SERVICE_ VARIANT="lms",PATH="/edx/app/ edxapp/venvs/edxapp/bin:/edx/ app/edxapp/edx-platform/bin:/ edx/app/edxapp/edx-platform/ node_modules/.bin:/usr/local/ sbin:/usr/local/bin:/usr/sbin: /usr/bin:/sbin:/bin"
user=www-data
stdout_logfile=/edx/var/log/ supervisor/%(program_name)s- stdout.log
stderr_logfile=/edx/var/log/ supervisor/%(program_name)s- stderr.log
autostart=true
autorestart=true
command=/edx/app/celery_beat_ script/celery_beat.sh
______________________________ ___________
sudo chown www-data:www-data celery_beat_worker.conf
sudo ln -s /edx/app/supervisor/conf. available.d/celery_beat_ worker.conf /edx/app/supervisor/conf.d/ celery_beat_worker.conf
cd /edx/var/log/supervisor
If logs are not created then create them:
sudo nano /edx/var/log/supervisor/ celery_beat_worker-stdout.log
sudo nano /edx/var/log/supervisor/ celery_beat_worker-stderr.log
sudo chown www-data:www-data /edx/var/log/supervisor/ celery_beat_worker-stdout.log
sudo chown www-data:www-data /edx/var/log/supervisor/ celery_beat_worker-stderr.log
cd /edx/app/
mkdir celery_beat_script
nano celery_beat.sh
Its content :
------------------------------ --------------------------------------------------------------------------------------------------------------
#!/bin/bash
source /edx/app/edxapp/edxapp_env
source /edx/app/edxapp/venvs/edxapp/ bin/activate
cd /edx/app/edxapp/edx-platform
exec /edx/app/edxapp/venvs/edxapp/ bin/python /edx/app/edxapp/edx-platform/ manage.py lms --settings=aws celerybeat --schedule="/edx/app/celery_ beat_script/temp_file" --pidfile=
______________________________ _____________-----------------------------------------------------------
sudo chmod 777 celery_beat.sh
sudo nano temp_file (set 644 permission)
cd ..
sudo chmod 777 /edx/app/celery_beat_script
(The permission folder celery_beat_script are 777 for now but should be set to more standard access)
sudo /edx/app/supervisor/venvs/ supervisor/bin/supervisorctl reread
sudo /edx/app/supervisor/venvs/ supervisor/bin/supervisorctl update
-------===================================================================================================
2. EDX production celery_async configuration:
cd /edx/app/supervisor/conf. available.d
sudo nano celery_async_worker.conf
Its content:
____________________________
[program:celery_async_worker]
directory=/edx/app/edxapp/edx- platform/
environment=DJANGO_SETTINGS_ MODULE=lms.envs.aws,SERVICE_ VARIANT="lms",PATH="/edx/app/ edxapp/venvs/edxapp/bin:/edx/ app/edxapp/edx-platform/bin:/ edx/app/edxapp/edx-platform/ node_modules/.bin:/usr/local/ sbin:/usr/local/bin:/usr/sbin: /usr/bin:/sbin:/bin"
user=www-data
stdout_logfile=/edx/var/log/ supervisor/%(program_name)s- stdout.log
stderr_logfile=/edx/var/log/ supervisor/%(program_name)s- stderr.log
autostart=true
autorestart=true
startsecs=10
stopwaitsecs = 1000
command=/edx/app/celery_beat_ script/celery_async.sh
______________________________ ___________
sudo chown www-data:www-data celery_async_worker.conf
sudo ln -s /edx/app/supervisor/conf. available.d/celery_async_ worker.conf /edx/app/supervisor/conf.d/ celery_async_worker.conf
cd /edx/var/log/supervisor
If logs are not created then create them:
------------------------------ ------------------------------ ------------
sudo nano /edx/var/log/supervisor/ celery_async_worker-stdout.log
sudo nano /edx/var/log/supervisor/ celery_async_worker-stderr.log
sudo chown www-data:www-data /edx/var/log/supervisor/ celery_async_worker-stdout.log
sudo chown www-data:www-data /edx/var/log/supervisor/ celery_async_worker-stderr.log
------------------------------ ------------------------------ -------------------------
cd /edx/app/celery_beat_script/
nano celery_async.sh
Its content :
------------------------------ ------------------------------------------------------------------------------------------------------
#!/bin/bash
source /edx/app/edxapp/edxapp_env
source /edx/app/edxapp/venvs/edxapp/ bin/activate
cd /edx/app/edxapp/edx-platform
exec /edx/app/edxapp/venvs/edxapp/ bin/python /edx/app/edxapp/edx-platform/ manage.py lms celery worker -A lms --loglevel=info --concurrency=5 --settings=aws --pidfile=
______________________________ _____________-------------------------------------------------------
sudo chmod 777 celery_async.sh
sudo nano temp_file (set 644 permission)
cd ..
sudo chmod 777 /edx/app/celery_beat_script
(The permission folder celery_beat_script are 777 for now but should be set to more standard access)
sudo /edx/app/supervisor/venvs/ supervisor/bin/supervisorctl reread
sudo /edx/app/supervisor/venvs/ supervisor/bin/supervisorctl update