Mark a node unavailable for task scheduling.

Section: Swarm Basics

Drain a node

bash
bash
docker node update --availability drain worker-1
Explanation

Useful before maintenance or draining workloads.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Swarm Basics
List swarm nodes
List nodes in the swarm.
OpenIn sheetbashsame section
Inspect a node
Show low-level swarm node details.
OpenIn sheetbashsame section
Add node label
Add or update node labels.
OpenIn sheetbashsame section
Initialize swarm
Initialize the current engine as a swarm manager.
OpenIn sheetbashsame section
Initialize swarm with advertise address
Initialize swarm and advertise a specific manager IP.
OpenIn sheetbashsame section
Show worker join token
Show or rotate the worker join token.
OpenIn sheetbashsame section