Management of Services¶
VOR Stream uses Supervisor to manage services of an installation. Ansible deployments automatically configure the Supervisor process and VOR Stream subprocesses to start on system boot.
Note
The exact number of services that Supervisor manages is dependent upon the deployment scenario chosen. For instance, some deployments may connect to a remote Postgres instance instead of a self-contained Postgres installation. In this case, the Postgres instance is managed externally.
Sample Commands¶
While not a replacement for the Supervisor documentation, this guide is meant to highlight Supervisor commands that are useful when managing a VOR Stream installation.
Important
When running these commands, be sure to run them as the installer account,
e.g., vrisk
.
Status of Services¶
Check process statuses with the supervisorctl status
. This is handy when
trying to get a global view of the system to see if any services are down.
$ supervisorctl status
django-vault-agent RUNNING pid 13293, uptime 21:14:01
caddy RUNNING pid 13294, uptime 21:14:01
postgres RUNNING pid 13295, uptime 21:14:01
rabbitmq RUNNING pid 13296, uptime 21:14:01
sdk RUNNING pid 18757, uptime 20:57:24
sdk-vault-agent RUNNING pid 13298, uptime 21:14:01
super RUNNING pid 189374, uptime 3:29:33
super-vault-agent RUNNING pid 13300, uptime 21:14:01
uwsgi RUNNING pid 133476, uptime 14:38:26
vault RUNNING pid 13302, uptime 21:14:01
vault-agent RUNNING pid 13303, uptime 21:14:01
Check a service's logs¶
Recent log entries can be checked with the supervisorctl tail
command.
$ supervisorctl tail uwsgi
rs in 931 bytes} [Wed Feb 23 10:03:08 2022] OPTIONS /risk-engine/process/80/334/children/ => generated 0 bytes in 0 msecs (HTTP/1.1 200) 7 headers in 365 bytes (1 switches on core 0)
[pid: 158707|app: 0|req: 1239/1804] 10.123.1.91 () {56 vars in 1659 bytes} [Wed Feb 23 10:03:09 2022] GET /risk-engine/process/80/334/children/ => generated 1810 bytes in 47 msecs (HTTP/1.1 200) 8 headers in 248 bytes (1 switches on core 0)
[pid: 158707|app: 0|req: 1240/1805] 10.122.4.114 () {40 vars in 1305 bytes} [Wed Feb 23 10:03:10 2022] PUT /run-study/job-status/625/ => generated 0 bytes in 34 msecs (HTTP/1.1 200) 6 headers in 192 bytes (1 switches on core 0)
[pid: 158707|app: 0|req: 1241/1806] 10.122.4.114 () {40 vars in 1305 bytes} [Wed Feb 23 10:03:12 2022] PUT /run-study/job-status/625/ => generated 0 bytes in 28 msecs (HTTP/1.1 200) 6 headers in 192 bytes (1 switches on core 0)
[pid: 158707|app: 0|req: 1242/1807] 10.123.1.91 () {58 vars in 986 bytes} [Wed Feb 23 10:03:12 2022] OPTIONS /risk-engine/process/80/334/children => generated 0 bytes in 0 msecs (HTTP/1.1 200) 7 headers in 365 bytes (1 switches on core 0)
[pid: 158707|app: 0|req: 1243/1808] 10.123.1.91 () {56 vars in 931 bytes} [Wed Feb 23 10:03:12 2022] OPTIONS /risk-engine/process/80/334/children/ => generated 0 bytes in 0 msecs (HTTP/1.1 200) 7 headers in 365 bytes (1 switches on core 0)
[pid: 158707|app: 0|req: 1244/1809] 10.123.1.91 () {56 vars in 1659 bytes} [Wed Feb 23 10:03:12 2022] GET /risk-engine/process/80/334/children/ => generated 2526 bytes in 39 msecs (HTTP/1.1 200) 8 headers in 248 bytes (1 switches on core 0)
To follow a log, add the -f
flag, e.g., supervisorctl tail -f uwsgi
.
Restarting a service¶
If a service did not start properly, it may need to be restarted. Services can
be restarted with the supervisorctl restart
command.
Warning
Some services have dependencies or require extra commands to fully restart.
For example, if Vault is restarted, it will need to be
unsealed. Because of this,
avoid running the supervisorctl restart all
command.
$ supervisorctl restart super
super: stopped
super: started