From dc8ed2d510c93b20929db59725d649f5b31888f4 Mon Sep 17 00:00:00 2001 From: mmolitor87 Date: Fri, 1 Sep 2017 14:43:54 -0500 Subject: [PATCH] Supervisor celery simplification (#849) Combines celery confs under one process group for easy restarting. Updates docs to reflect new commands. --- docs/installation/auth/supervisor.md | 20 +++++++++++++++- thirdparty/Supervisor/auth-celerybeat.conf | 10 -------- thirdparty/Supervisor/auth-celeryd.conf | 13 ---------- thirdparty/Supervisor/auth.conf | 28 ++++++++++++++++++++++ 4 files changed, 47 insertions(+), 24 deletions(-) delete mode 100644 thirdparty/Supervisor/auth-celerybeat.conf delete mode 100644 thirdparty/Supervisor/auth-celeryd.conf create mode 100644 thirdparty/Supervisor/auth.conf diff --git a/docs/installation/auth/supervisor.md b/docs/installation/auth/supervisor.md index c616a539..276dfac0 100644 --- a/docs/installation/auth/supervisor.md +++ b/docs/installation/auth/supervisor.md @@ -22,7 +22,7 @@ CentOS: Auth provides example config files for the celery workers, the periodic task scheduler (celery beat), and the mumble authenticator. All of these are available in `thirdparty/Supervisor`. -For most users, all you have to do is copy the config files to `/etc/supervisor/conf.d` then restart the service. Copy `auth-celerybeat.conf` and `auth-celeryd.conf` for the celery workers, and `auth-mumble.conf` for the mumble authenticator. For all three just use a wildcard: +For most users, all you have to do is copy the config files to `/etc/supervisor/conf.d` then restart the service. Copy `auth.conf` for the celery workers, and `auth-mumble.conf` for the mumble authenticator. For all three just use a wildcard: sudo cp thirdparty/Supervisor/* /etc/supervisor/conf.d @@ -44,6 +44,24 @@ Processes will be `STARTING`, `RUNNING`, or `ERROR`. If an error has occurred, c - celery workers: `log/worker.log` - celery beat: `log/beat.log` - authenticator: `log/authenticator.log` + +## Restarting Processes + +To restart the celery group: + + sudo supervisorctl restart auth:* + +To restart just celerybeat: + + sudo supervisorctl restart auth:celerybeat + +To restart just celeryd: + + sudo supervisorctl restart auth:celeryd + +To restart just mumble authenticator: + + sudo supervisorctl restart auth-mumble ## Customizing Config Files diff --git a/thirdparty/Supervisor/auth-celerybeat.conf b/thirdparty/Supervisor/auth-celerybeat.conf deleted file mode 100644 index 527fd7e2..00000000 --- a/thirdparty/Supervisor/auth-celerybeat.conf +++ /dev/null @@ -1,10 +0,0 @@ -[program:auth-celerybeat] -command=celery -A alliance_auth beat -directory=/home/allianceserver/allianceauth -user=allianceserver -stdout_logfile=/home/allianceserver/allianceauth/log/beat.log -stderr_logfile=/home/allianceserver/allianceauth/log/beat.log -autostart=true -autorestart=true -startsecs=10 -priority=999 diff --git a/thirdparty/Supervisor/auth-celeryd.conf b/thirdparty/Supervisor/auth-celeryd.conf deleted file mode 100644 index 033cdc88..00000000 --- a/thirdparty/Supervisor/auth-celeryd.conf +++ /dev/null @@ -1,13 +0,0 @@ -[program:auth-celeryd] -command=celery -A alliance_auth worker -directory=/home/allianceserver/allianceauth -user=allianceserver -numprocs=1 -stdout_logfile=/home/allianceserver/allianceauth/log/worker.log -stderr_logfile=/home/allianceserver/allianceauth/log/worker.log -autostart=true -autorestart=true -startsecs=10 -stopwaitsecs = 600 -killasgroup=true -priority=1000 diff --git a/thirdparty/Supervisor/auth.conf b/thirdparty/Supervisor/auth.conf new file mode 100644 index 00000000..381bec6f --- /dev/null +++ b/thirdparty/Supervisor/auth.conf @@ -0,0 +1,28 @@ +[program:celerybeat] +command=celery -A alliance_auth beat +directory=/home/allianceserver/allianceauth +user=allianceserver +stdout_logfile=/home/allianceserver/allianceauth/log/beat.log +stderr_logfile=/home/allianceserver/allianceauth/log/beat.log +autostart=true +autorestart=true +startsecs=10 +priority=998 + +[program:celeryd] +command=celery -A alliance_auth worker +directory=/home/allianceserver/allianceauth +user=allianceserver +numprocs=1 +stdout_logfile=/home/allianceserver/allianceauth/log/worker.log +stderr_logfile=/home/allianceserver/allianceauth/log/worker.log +autostart=true +autorestart=true +startsecs=10 +stopwaitsecs = 600 +killasgroup=true +priority=998 + +[group:auth] +programs=celerybeat,celeryd +priority=999