Installation guide · Several servers
Drain and stop a worker
Drain and stop a worker, read the Servers section, and find why a worker was refused.
To take a worker out without cutting off a search, drain it, then stop it:
docker exec sequences-w1 /opt/node/bin/node /app/services/biosequence/container/start.mjs drain
docker stop sequences-w1
drain asks the worker to finish the searches it runs and take no more. It names the searches it waits for, and it ends with 0 once the worker runs none:
Asked worker w1 to drain: it finishes the searches it runs and takes no more.
Waiting for the search it runs: <search ID>.
Worker w1 is drained: it runs no search. Stop it now.
It ends with 1 at once on a server that is not a worker, or when no worker runs on that volume, and later if the worker stops before it drains. A search that reaches the worker after the drain began goes back to the queue at once. The coordinator's log and the usage page show the worker as draining, then drained. A drained worker takes no search until it starts again.
It also ends with 1 if the worker starts again before it drains, since a start clears the drain and the worker takes searches again, and after 60 minutes, or the minutes drain --wait <minutes> gives, from 1 to 1440. Then it says what the worker last said, and the drain stays asked, so the worker takes no more searches:
Stopped waiting after 60 min. Worker w1's status file, written 4.2 s before, said: Draining, with the search it runs: <search ID>.
The drain stays asked, so the worker takes no more searches. Run drain again to wait longer, or stop the worker, which gives back the searches it runs.
A docker stop without a drain gives back the searches the worker runs: they wait in the queue again, in their place, and start over on the next free server. A worker that stops answering, as after a crash or a network fault, is lost after 60 seconds, and its searches wait in the queue again too. A search cut off three times this way fails with "The search was cut off 3 times before it finished. Submit it again." A stop or a drain never counts as a cut.
The Servers section
On a coordinator, the usage page ends with a Servers section for its admins. A line counts the workers that take searches and how many searches they run at once. Then a row for each worker gives its name; its state: Starting, Checking its snapshot, Ready, Busy, Waiting for the coordinator, Draining, Drained, Lost, or Refused with the reason, such as "Refused: another release"; the searches it runs; how many it runs at a time; the snapshot and delta copies that match the coordinator's, with any that differ under them; and when the coordinator last heard from it. Reload the page to read it again.
GET /api/admin/workers gives the same list to an admin's program, and GET /api/status on a coordinator adds servers: the workers that take searches now and how many searches of a snapshot run at once.
When the coordinator refuses a worker
The worker's log says what to change, and a refused worker fails its health check. The coordinator logs each refusal once, notes it in its audit log and shows the worker on the usage page as Refused, with the reason. A worker with another key is never named there: the coordinator's audit log notes its requests without a name. Fix the cause and start the worker again. A worker refused for its name joins by itself once the other worker of that name has been silent for 30 seconds, as after a crash.
| Refusal | What to change |
|---|---|
| Another release, other search programs, or other search settings | Run one image on every server |
| Another paper folder | Copy the coordinator's paper folder into the worker's volume as it is, and set the same BIOSEQUENCE_PAPERS |
| Another taxa folder | Copy the coordinator's taxa folder into the worker's volume as it is, and set the same BIOSEQUENCE_TAXA |
| Its name is in use | Give each worker its own BIOSEQUENCE_WORKER_NAME |
| The worker key | Use the same worker key on every server |
A snapshot or delta copy that differs from the coordinator's is not a refusal: the worker takes no search of it and goes on with the searches of its other copies. Its log names up to five files that differ, and the usage page lists the copy under Differs. Load that copy again from the files you received.
Guide version 1.63.0 · For Sequences 0.155.0