github.com/dkerwin/nomad@v0.3.3-0.20160525181927-74554135514b/website/source/docs/commands/node-drain.html.md.erb (about) 1 --- 2 layout: "docs" 3 page_title: "Commands: node-drain" 4 sidebar_current: "docs-commands-node-drain" 5 description: > 6 Toggle drain mode for a given node. 7 --- 8 9 # Command: node-drain 10 11 The `node-drain` command is used to toggle drain mode on a given node. Drain 12 mode prevents any new tasks from being allocated to the node, and begins 13 migrating all existing allocations away. 14 15 The [node-status](/docs/commands/node-status.html) command compliments this 16 nicely by providing the current drain status of a given node. 17 18 ## Usage 19 20 ``` 21 nomad node-drain [options] <node> 22 ``` 23 24 A `-self` flag can be used to drain the local node. If this is not supplied, a 25 node ID or prefix must be provided. If there is an exact match, the drain mode 26 will be adjusted for that node. Otherwise, a list of matching nodes and 27 information will be displayed. 28 29 It is also required to pass one of `-enable` or `-disable`, depending on which 30 operation is desired. 31 32 ## General Options 33 34 <%= general_options_usage %> 35 36 ## Node Drain Options 37 38 * `-enable`: Enable node drain mode. 39 * `-disable`: Disable node drain mode. 40 * `-self`: Drain the local node. 41 * `-yes`: Automtic yes to prompts. 42 43 ## Examples 44 45 Enable drain mode on node with ID prefix "4d2ba53b": 46 47 ``` 48 $ nomad node-drain -enable 4d2ba53b 49 ``` 50 51 Enable drain mode on the local node: 52 53 ``` 54 $ nomad node-drain -enable -self 55 ```