github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/docs/commands/alloc/stop.mdx (about)

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