github.com/dkerwin/nomad@v0.3.3-0.20160525181927-74554135514b/website/source/docs/commands/run.html.md.erb (about) 1 --- 2 layout: "docs" 3 page_title: "Commands: run" 4 sidebar_current: "docs-commands-run" 5 description: > 6 The run command is used to run a new job. 7 --- 8 9 # Command: run 10 11 The `run` command is used to submit new jobs to Nomad or to update existing 12 jobs. Job files must conform to the [job specification](/docs/jobspec/index.html) 13 format. 14 15 ## Usage 16 17 ``` 18 nomad run [options] <file> 19 ``` 20 21 The run command requires a single argument, specifying the path to a file 22 containing a valid [job specification](/docs/jobspec/index.html). This file 23 will be read and the job will be submitted to Nomad for scheduling. 24 25 By default, on successful job submission the run command will enter an 26 interactive monitor and display log information detailing the scheduling 27 decisions and placement information for the provided job. The monitor will 28 exit after scheduling has finished or failed. 29 30 On successful job submission and scheduling, exit code 0 will be returned. If 31 there are job placement issues encountered (unsatisfiable constraints, resource 32 exhaustion, etc), then the exit code will be 2. Any other errors, including 33 client connection issues or internal errors, are indicated by exit code 1. 34 35 ## General Options 36 37 <%= general_options_usage %> 38 39 ## Run Options 40 41 * `-detach`: Return immediately instead of monitoring. A new evaluation ID 42 will be output, which can be used to call the monitor later using the 43 [eval-monitor](/docs/commands/eval-monitor.html) command. 44 45 * `-output`: Output the JSON that would be submitted to the HTTP API without 46 submitting the job. 47 48 ## Status Options 49 50 * `-verbose`: Show full information. 51 52 ## Examples 53 54 Schedule the job contained in the file `job1.nomad`, monitoring placement: 55 56 ``` 57 $ nomad run job1.nomad 58 ==> Monitoring evaluation "52dee78a" 59 Allocation "5e0b39f0" created: node "3e84d3d2", group "group1" 60 Allocation "5e0b39f0" status changed: "pending" -> "running" 61 Evaluation status changed: "pending" -> "complete" 62 ==> Evaluation "52dee78a" finished with status "complete" 63 ``` 64 65 Schedule the job contained in `job1.nomad` and return immediately: 66 67 ``` 68 $ nomad run -detach job1.nomad 69 4947e728 70 ``` 71 72 Schedule a job which cannot get placement. This results in a scheduling failure 73 and the specifics of the placement are printed: 74 75 ``` 76 $ nomad run failing.nomad 77 ==> Monitoring evaluation "0d7447d9" 78 Scheduling error for group "group1" (failed to find a node for placement) 79 Allocation "a739288e" status "failed" (1/1 nodes filtered) 80 * Constraint "$attr.kernel.name = linux" filtered 1 nodes 81 Evaluation status changed: "pending" -> "complete" 82 ==> Evaluation "0d7447d9" finished with status "complete" 83 ```