Jasmine W a9df6ac50b
docs: update structure (#8506)
- moved and renamed files/folders based on new structure
- updated docs navigation based on new structure
- moved CLI to top nav (created commands.jsx and commands-navigation.js)
- updated and added redirects
- updating to be consistent with standalone categories
- changing "overview" link in top nav to lead to where intro was moved (docs/intro)
- adding redirects for intro content
- deleting old intro folders
- format all data/navigation files
- deleting old commands folder
- reverting changes to glossary page
- adjust intro navigation for removal of 'vs' paths
- add helm page redirect
- fix more redirects
- add a missing redirect
- fix broken anchor links and formatting mistakes
- deleted duplicate section, added redirect, changed link
- removed duplicate glossary page
2020-09-01 11:14:13 -04:00

63 lines
1.9 KiB
Plaintext

---
layout: commands
page_title: 'Commands: Maint'
sidebar_title: maint
description: |
The `maint` command provides control of both service and node maintenance mode
---
# Consul Maint
Command: `consul maint`
The `maint` command provides control of service maintenance mode.
Using the command, it is possible to mark a service provided by a node or all the services on the
node as a whole as "under maintenance". In this mode of operation, the service
will not appear in DNS query results, or API results. This effectively
takes the service out of the pool of available "healthy" nodes of a service.
Under the hood, maintenance mode is activated by registering a health check in
critical status against a service, and deactivated by deregistering the
health check.
## Usage
Usage: `consul maint [options]`
#### API Options
@include 'http_api_options_client.mdx'
#### Command Options
- `-enable` - Enable maintenance mode on all services on a node. If
combined with the `-service` flag, we operate on a specific service ID.
- `-disable` - Disable maintenance mode on all services on a node. If
combined with the `-service` flag, we operate on a specific service ID.
- `-reason` - An optional reason for placing the service into
maintenance mode. If provided, this reason will be visible in the newly-
registered critical check's "Notes" field.
- `-service` - An optional service ID to control maintenance mode for a given service. By
providing this flag, the `-enable` and `-disable` flags functionality is
modified to operate on the given service ID.
## List mode
If neither `-enable` nor `-disable` are passed, the `maint` command will
switch to "list mode", displaying any current maintenances. This may return
blank if nothing is currently under maintenance. The output will look like:
```shell-session
$ consul maint
Node:
Name: node1.local
Reason: This node is broken.
Service:
ID: redis
Reason: Redis is currently offline.
```