2015-09-18 06:39:31 +00:00
|
|
|
---
|
|
|
|
layout: "docs"
|
|
|
|
page_title: "Commands: stop"
|
|
|
|
sidebar_current: "docs-commands-stop"
|
|
|
|
description: >
|
|
|
|
The stop command is used to stop a running job.
|
|
|
|
---
|
|
|
|
|
|
|
|
# Command: stop
|
|
|
|
|
|
|
|
The `stop` command is used to stop a running job and signals the scheduler
|
|
|
|
to cancel all of the running allocations.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
```
|
|
|
|
nomad stop [options] <job>
|
|
|
|
```
|
|
|
|
|
2016-01-06 21:46:57 +00:00
|
|
|
The stop command requires a single argument, specifying the job ID or prefix to
|
|
|
|
cancel. If there is an exact match based on the provided job ID or prefix, then
|
|
|
|
the job will be cancelled. Otherwise, a list of matching jobs and information
|
|
|
|
will be displayed.
|
2015-09-18 06:39:31 +00:00
|
|
|
|
2015-10-26 20:20:10 +00:00
|
|
|
Upon successful deregistration, an interactive monitor session will start to
|
2015-09-18 06:39:31 +00:00
|
|
|
display log lines as the job unwinds its allocations and completes shutting
|
|
|
|
down. The monitor will exit once all allocations are stopped and the job has
|
|
|
|
reached a terminal state. It is safe to exit the monitor early using ctrl+c.
|
|
|
|
|
|
|
|
## General Options
|
|
|
|
|
|
|
|
<%= general_options_usage %>
|
|
|
|
|
|
|
|
## Stop Options
|
|
|
|
|
2016-05-26 01:52:14 +00:00
|
|
|
* `-detach`: Return immediately instead of entering monitor mode. After the
|
|
|
|
deregister command is submitted, a new evaluation ID is printed to the screen,
|
|
|
|
which can be used to examine the evaluation using the
|
|
|
|
[eval-status](/docs/commands/eval-status.html) command.
|
2015-09-18 06:39:31 +00:00
|
|
|
|
2016-01-19 23:01:26 +00:00
|
|
|
## Status Options
|
|
|
|
|
|
|
|
* `-verbose`: Show full information.
|
|
|
|
|
2015-09-18 06:39:31 +00:00
|
|
|
## Examples
|
|
|
|
|
2015-09-21 19:05:48 +00:00
|
|
|
Stop the job with ID "job1":
|
2015-09-18 06:39:31 +00:00
|
|
|
|
|
|
|
```
|
2015-09-21 19:05:48 +00:00
|
|
|
$ nomad stop job1
|
2016-01-19 23:01:26 +00:00
|
|
|
==> Monitoring evaluation "43bfe672"
|
2015-09-21 19:05:48 +00:00
|
|
|
Evaluation status changed: "pending" -> "complete"
|
2016-01-19 23:01:26 +00:00
|
|
|
==> Evaluation "43bfe672" finished with status "complete"
|
2015-09-18 06:39:31 +00:00
|
|
|
```
|
|
|
|
|
2015-09-21 19:05:48 +00:00
|
|
|
Stop the job with ID "job1" and return immediately:
|
2015-09-18 06:39:31 +00:00
|
|
|
|
|
|
|
```
|
2015-09-21 19:05:48 +00:00
|
|
|
$ nomad stop -detach job1
|
2016-01-19 23:01:26 +00:00
|
|
|
507d26cb
|
2015-09-18 06:39:31 +00:00
|
|
|
```
|