2019-04-23 11:22:27 +00:00
|
|
|
---
|
2020-02-06 23:45:31 +00:00
|
|
|
layout: docs
|
|
|
|
page_title: 'Commands: alloc stop'
|
|
|
|
description: |
|
2019-04-23 11:22:27 +00:00
|
|
|
Stop and reschedule a running allocation
|
|
|
|
---
|
|
|
|
|
2019-06-05 15:09:22 +00:00
|
|
|
# Command: alloc stop
|
2019-04-23 11:22:27 +00:00
|
|
|
|
2019-04-24 19:51:26 +00:00
|
|
|
The `alloc stop` command allows a user to perform an in-place restart of an
|
|
|
|
entire allocation or individual task.
|
2019-04-23 11:22:27 +00:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2019-10-22 13:44:00 +00:00
|
|
|
```plaintext
|
2019-04-23 11:22:27 +00:00
|
|
|
nomad alloc stop [options] <allocation>
|
|
|
|
```
|
|
|
|
|
|
|
|
The `alloc stop` command requires a single argument, specifying the alloc ID or
|
|
|
|
prefix to stop. If there is an exact match based on the provided alloc ID or
|
|
|
|
prefix, then the alloc will be stopped and rescheduled. Otherwise, a list of
|
|
|
|
matching allocs and information will be displayed.
|
|
|
|
|
2020-02-06 23:45:31 +00:00
|
|
|
Stop will issue a request to stop and reschedule the allocation. An interactive
|
2019-04-23 11:22:27 +00:00
|
|
|
monitoring session will display log lines as the allocation completes shutting
|
|
|
|
down. It is safe to exit the monitor early with ctrl-c.
|
|
|
|
|
2020-11-19 21:38:08 +00:00
|
|
|
When ACLs are enabled, this command requires a token with the
|
|
|
|
`alloc-lifecycle`, `read-job`, and `list-jobs` capabilities for the
|
|
|
|
allocation's namespace.
|
|
|
|
|
2019-04-23 11:22:27 +00:00
|
|
|
## General Options
|
|
|
|
|
2020-02-06 23:45:31 +00:00
|
|
|
@include 'general_options.mdx'
|
2019-04-23 11:22:27 +00:00
|
|
|
|
|
|
|
## Stop Options
|
|
|
|
|
2019-10-22 13:44:00 +00:00
|
|
|
- `-detach`: Return immediately instead of entering monitor mode. After the
|
2020-02-06 23:45:31 +00:00
|
|
|
stop command is submitted, a new evaluation ID is printed to the
|
|
|
|
screen, which can be used to examine the rescheduling evaluation using the
|
|
|
|
[eval status] command.
|
2019-04-23 11:22:27 +00:00
|
|
|
|
2019-10-22 13:44:00 +00:00
|
|
|
- `-verbose`: Display verbose output.
|
2019-04-23 11:22:27 +00:00
|
|
|
|
2021-12-13 19:54:53 +00:00
|
|
|
- `-no-shutdown-delay`
|
|
|
|
Ignore the the group and task [`shutdown_delay`] configuration so that
|
|
|
|
there is no delay between service deregistration and task
|
|
|
|
shutdown. Note that using this flag will result in failed network
|
|
|
|
connections to the allocation being stopped.
|
|
|
|
|
2019-04-23 11:22:27 +00:00
|
|
|
## Examples
|
|
|
|
|
2020-05-18 20:53:06 +00:00
|
|
|
```shell-session
|
|
|
|
$ nomad alloc stop c1488bb5
|
2019-04-23 11:22:27 +00:00
|
|
|
==> Monitoring evaluation "26172081"
|
|
|
|
Evaluation triggered by job "example"
|
|
|
|
Allocation "4dcb1c98" created: node "b4dc52b9", group "cache"
|
|
|
|
Evaluation within deployment: "c0c594d0"
|
|
|
|
Evaluation status changed: "pending" -> "complete"
|
|
|
|
==> Evaluation "26172081" finished with status "complete"
|
|
|
|
|
|
|
|
$ nomad alloc stop -detach eb17e557
|
|
|
|
8a91f0f3-9d6b-ac83-479a-5aa186ab7795
|
|
|
|
```
|
|
|
|
|
2020-02-06 23:45:31 +00:00
|
|
|
[eval status]: /docs/commands/eval-status
|
2021-12-13 19:54:53 +00:00
|
|
|
[`shutdown_delay`]: /docs/job-specification/group#shutdown_delay
|