diff --git a/website/source/docs/commands/eval-monitor.html.md.erb b/website/source/docs/commands/eval-monitor.html.md.erb new file mode 100644 index 000000000..13062f338 --- /dev/null +++ b/website/source/docs/commands/eval-monitor.html.md.erb @@ -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] +``` + +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" +``` diff --git a/website/source/docs/commands/run.html.md.erb b/website/source/docs/commands/run.html.md.erb new file mode 100644 index 000000000..dcbf13fd8 --- /dev/null +++ b/website/source/docs/commands/run.html.md.erb @@ -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] +``` + +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 +``` diff --git a/website/source/docs/commands/stop.html.md.erb b/website/source/docs/commands/stop.html.md.erb new file mode 100644 index 000000000..b3fbb1099 --- /dev/null +++ b/website/source/docs/commands/stop.html.md.erb @@ -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] +``` + +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 +``` diff --git a/website/source/layouts/docs.erb b/website/source/layouts/docs.erb index d77233c50..a651a2b46 100644 --- a/website/source/layouts/docs.erb +++ b/website/source/layouts/docs.erb @@ -80,6 +80,9 @@ > agent-members + > + eval-monitor + > node-drain