github.com/zhizhiboom/nomad@v0.8.5-0.20180907175415-f28fd3a1a056/website/source/docs/commands/agent.html.md.erb (about) 1 --- 2 layout: "docs" 3 page_title: "Commands: agent" 4 sidebar_current: "docs-commands-_agent" # Use "_" to break prefix match 5 description: > 6 The agent command is the main entrypoint to running a Nomad client 7 or server. 8 --- 9 10 # Command: agent 11 12 The agent command is the heart of Nomad: it runs the agent that handles client 13 or server functionality, including exposing interfaces for client consumption 14 and running jobs. 15 16 Due to the power and flexibility of this command, the Nomad agent is documented 17 in its own section. See the [Nomad Agent](/guides/operations/agent/index.html) 18 guide and the [Configuration](/docs/configuration/index.html) documentation section for 19 more information on how to use this command and the options it has. 20 21 ## Command-line Options 22 23 A subset of the available Nomad agent configuration can optionally be passed in 24 via CLI arguments. The `agent` command accepts the following arguments: 25 26 * `-alloc-dir=<path>`: Equivalent to the Client [alloc_dir](#alloc_dir) config 27 option. 28 * `-acl-enabled`: Equivalent to the ACL [enabled](/docs/configuration/acl.html#enabled) config option. 29 * `-acl-replication-token`: Equivalent to the ACL [replication_token](/docs/configuration/acl.html#replication_token) config option. 30 * `-bind=<address>`: Equivalent to the [bind_addr](#bind_addr) config option. 31 * `-bootstrap-expect=<num>`: Equivalent to the 32 [bootstrap_expect](#bootstrap_expect) config option. 33 * `-client`: Enable client mode on the local agent. 34 * `-config=<path>`: Specifies the path to a configuration file or a directory of 35 configuration files to load. Can be specified multiple times. 36 * `-consul-address=<addr>`: Equivalent to the [address](/docs/configuration/consul.html#address) config option. 37 * `-consul-auth=<auth>`: Equivalent to the [auth](/docs/configuration/consul.html#auth) config option. 38 * `-consul-auto-advertise`: Equivalent to the [auto_advertise](/docs/configuration/consul.html#auto_advertise) config option. 39 * `-consul-ca-file=<path>`: Equivalent to the [ca_file](/docs/configuration/consul.html#ca_file) config option. 40 * `-consul-cert-file=<path>`: Equivalent to the [cert_file](/docs/configuration/consul.html#cert_file) config option. 41 * `-consul-checks-use-advertise`: Equivalent to the [checks_use_advertise](/docs/configuration/consul.html#checks_use_advertise) config option. 42 * `-consul-client-auto-join`: Equivalent to the [client_auto_join](/docs/configuration/consul.html#client_auto_join) config option. 43 * `-consul-client-service-name=<name>`: Equivalent to the [client_service_name](/docs/configuration/consul.html#client_service_name) config option. 44 * `-consul-client-http-check-name=<name>`: Equivalent to the [client_http_check_name](/docs/configuration/consul.html#client_http_check_name) config option. 45 * `-consul-key-file=<path>`: Equivalent to the [key_file](/docs/configuration/consul.html#key_file) config option. 46 * `-consul-server-service-name=<name>`: Equivalent to the [server_service_name](/docs/configuration/consul.html#server_service_name) config option. 47 * `-consul-server-http-check-name=<name>`: Equivalent to the [server_http_check_name](/docs/configuration/consul.html#server_http_check_name) config option. 48 * `-consul-server-serf-check-name=<name>`: Equivalent to the [server_serf_check_name](/docs/configuration/consul.html#server_serf_check_name) config option. 49 * `-consul-server-rpc-check-name=<name>`: Equivalent to the [server_rpc_check_name](/docs/configuration/consul.html#server_rpc_check_name) config option. 50 * `-consul-server-auto-join`: Equivalent to the [server_auto_join](/docs/configuration/consul.html#server_auto_join) config option. 51 * `-consul-ssl`: Equivalent to the [ssl](/docs/configuration/consul.html#ssl) config option. 52 * `-consul-token=<token>`: Equivalent to the [token](/docs/configuration/consul.html#token) config option. 53 * `-consul-verify-ssl`: Equivalent to the [verify_ssl](/docs/configuration/consul.html#verify_ssl) config option. 54 * `-data-dir=<path>`: Equivalent to the [data_dir](/docs/configuration/index.html#data_dir) config option. 55 * `-dc=<datacenter>`: Equivalent to the [datacenter](#datacenter) config option. 56 * `-dev`: Start the agent in development mode. This enables a pre-configured 57 dual-role agent (client + server) which is useful for developing or testing 58 Nomad. No other configuration is required to start the agent in this mode. 59 * `-encrypt`: Set the Serf encryption key. See the [Encryption Overview](/guides/security/encryption.html) for more details. 60 * `-join=<address>`: Address of another agent to join upon starting up. This can 61 be specified multiple times to specify multiple agents to join. 62 * `-log-level=<level>`: Equivalent to the [log_level](#log_level) config option. 63 * `-meta=<key=value>`: Equivalent to the Client [meta](#meta) config option. 64 * `-network-interface=<interface>`: Equivalent to the Client 65 [network_interface](#network_interface) config option. 66 * `-network-speed=<MBits>`: Equivalent to the Client 67 [network_speed](#network_speed) config option. 68 * `-node=<name>`: Equivalent to the [name](#name) config option. 69 * `-node-class=<class>`: Equivalent to the Client [node_class](#node_class) 70 config option. 71 * `-plugin-dir=<path>`: Equivalent to the [plugin_dir](/docs/configuration/index.html#plugin_dir) config option. 72 * `-region=<region>`: Equivalent to the [region](#region) config option. 73 * `-rejoin`: Equivalent to the [rejoin_after_leave](#rejoin_after_leave) config option. 74 * `-retry-interval`: Equivalent to the [retry_interval](#retry_interval) config option. 75 * `-retry-join`: Similar to `-join` but allows retrying a join if the first attempt fails. 76 77 ```sh 78 $ nomad agent -retry-join "127.0.0.1:4648" 79 ``` 80 81 `retry-join` can be defined as a command line flag only for servers. Clients 82 can configure `retry-join` only in configuration files. 83 84 * `-retry-max`: Similar to the [retry_max](#retry_max) config option. 85 * `-server`: Enable server mode on the local agent. 86 * `-servers=<host:port>`: Equivalent to the Client [servers](#servers) config 87 option. 88 * `-state-dir=<path>`: Equivalent to the Client [state_dir](#state_dir) config 89 option. 90 * `-vault-enabled`: Whether to enable or disabled Vault integration. 91 * `-vault-address=<addr>`: The address to communicate with Vault. 92 * `-vault-token=<token>`: The Vault token used to derive tokens. Only needs to 93 be set on Servers. Overrides the Vault token read from the VAULT_TOKEN 94 environment variable. 95 * `-vault-create-from-role=<role>`: The role name to create tokens for tasks from. 96 * `-vault-ca-file=<path>`: Path to a PEM-encoded CA cert file used to verify the 97 Vault server SSL certificate. 98 * `-vault-ca-path=<path>`: Path to a directory of PEM-encoded CA cert files used 99 to verify the Vault server SSL certificate.Whether to enable or disabled Vault 100 integration. 101 * `vault-cert-file=<path>`: The path to the certificate for Vault communication. 102 * `vault-key-file=<path>`: The path to the private key for Vault communication. 103 * `vault-tls-skip-verify`: A boolean that determines whether to skip SSL 104 certificate verification. 105 * `vault-tls-server-name=<name>`: Used to set the SNI host when connecting to 106 Vault over TLS.