website: document run, stop, eval-monitor

This commit is contained in:
Ryan Uber
2015-09-17 23:39:31 -07:00
parent eb60a5fdc1
commit 45eeee06ab
4 changed files with 159 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
---
layout: "docs"
page_title: "Commands: eval-monitor"
sidebar_current: "docs-commands-eval-monitor"
description: >
The eval-monitor command is used to attach a log monitor to an existing
evaluation using its ID.
---
# Command: eval-monitor
The `eval-monitor` command is used to monitor an existion [evaluation](#).
Logs will be output describing state changes to the evaluation or its
associated [allocations](#). The monitor will exit when the evaluation
reaches a terminal state.
## Usage
```
nomad eval-monitor [options] <eval>
```
The eval-monitor command requires a single argument, specifying the
evaluation ID to monitor. An interactive monitoring session will be
started in the terminal. It is safe to exit the monitor at any time
using ctrl+c.
## General Options
<%= general_options_usage %>
## Examples
Monitor an existing evaluation
```
$ nomad eval-monitor d00797d8-7bc3-fbc7-ae0d-5af0260a871f
==> Monitoring evaluation "d00797d8-7bc3-fbc7-ae0d-5af0260a871f"
2015/09/17 23:21:24 Evaluation status changed: "pending" -> "complete"
==> Evaluation "d00797d8-7bc3-fbc7-ae0d-5af0260a871f" finished with status "complete"
```

View File

@@ -0,0 +1,58 @@
---
layout: "docs"
page_title: "Commands: run"
sidebar_current: "docs-commands-run"
description: >
The run command is used to run a new job.
---
# Command: run
The `run` command is used to run new jobs in Nomad. Jobs are specified using
[HCL](https://github.com/hashicorp/hcl)-encoded files, and may specify one or
more task groups. More information about jobs and their configuration format
can be found in the [jobs documentation](#).
## Usage
```
nomad run [options] <file>
```
The run command requires a single argument, specifying the path to a file
containing a valid [job definition](#). This file will be read and the job
will be submitted to the Nomad server for scheduling.
By default, on sucessful job submission, the run command will enter an
interactive monitor and display log information detailing the scheduling
decisions and placement information for the provided job. The monitor will
exit after scheduling has finished or failed.
## General Options
<%= general_options_usage %>
## Run Options
* `-detach`: Return immediately instead of monitoring. A new evaluation ID
will be output, which can be used to call the monitor later using the
[eval-monitor](/docs/commands/eval-monitor.html) command.
## Examples
Stop a running job and monitor shutdown:
```
$ nomad stop job1
==> Monitoring evaluation "d00797d8-7bc3-fbc7-ae0d-5af0260a871f"
2015/09/17 23:21:23 Evaluation status changed: "" -> "pending"
2015/09/17 23:21:24 Evaluation status changed: "pending" -> "complete"
==> Evaluation "d00797d8-7bc3-fbc7-ae0d-5af0260a871f" finished with status "complete"
```
Stop a running job and return immediately:
```
$ nomad stop -detach job1
4947e728-fb4e-90c6-895a-42479940e0bc
```

View File

@@ -0,0 +1,57 @@
---
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>
```
The stop command requires a single argument, specifying the job ID to
cancel.
Upon successful deregistraion, an interactive monitor session will start to
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
* `-detach`: Return immediately instead of monitoring. A new evaluation ID
will be output, which can be used to call the monitor later using the
[eval-monitor](/docs/commands/eval-monitor.html) command.
## Examples
Run a new job and monitor placement:
```
$ nomad run job1.job
==> Monitoring evaluation "ffd1d625-c208-bf36-ac34-17f3191a7b57"
2015/09/17 23:02:14 Allocation "020a32d1-e3a8-b67e-f41a-1a49853b472a" created: node "dd522226-6f0b-6ecd-1ae1-17670e448985", group "group1"
2015/09/17 23:02:14 Evaluation status changed: "" -> "pending"
2015/09/17 23:02:15 Allocation "020a32d1-e3a8-b67e-f41a-1a49853b472a" status changed: "pending" -> "running"
2015/09/17 23:02:15 Evaluation status changed: "pending" -> "complete"
==> Evaluation "ffd1d625-c208-bf36-ac34-17f3191a7b57" finished with status "complete"
```
Run a new job and return immediately:
```
$ nomad run -detach job1.job
507d26cb-1d67-672c-da9d-f6053837bb70
```

View File

@@ -80,6 +80,9 @@
<li<%= sidebar_current("docs-commands-agent-members") %>>
<a href="/docs/commands/agent-members.html">agent-members</a>
</li>
<li<%= sidebar_current("docs-commands-eval-monitor") %>>
<a href="/docs/commands/eval-monitor.html">eval-monitor</a>
</li>
<li<%= sidebar_current("docs-commands-node-drain") %>>
<a href="/docs/commands/node-drain.html">node-drain</a>
</li>