github.com/ferranbt/nomad@v0.9.3-0.20190607002617-85c449b7667c/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/install/production/nomad-agent.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](/docs/configuration/index.html#log_level) config option.
    63  * `-log-json`: Equivalent to the [log_json](/docs/configuration/index.html#log_json) config option.
    64  * `-meta=<key=value>`: Equivalent to the Client [meta](#meta) config option.
    65  * `-network-interface=<interface>`: Equivalent to the Client
    66     [network_interface](#network_interface) config option.
    67  * `-network-speed=<MBits>`: Equivalent to the Client
    68    [network_speed](#network_speed) config option.
    69  * `-node=<name>`: Equivalent to the [name](#name) config option.
    70  * `-node-class=<class>`: Equivalent to the Client [node_class](#node_class)
    71    config option.
    72  * `-plugin-dir=<path>`: Equivalent to the [plugin_dir](/docs/configuration/index.html#plugin_dir) config option.
    73  * `-region=<region>`: Equivalent to the [region](#region) config option.
    74  * `-rejoin`: Equivalent to the [rejoin_after_leave](#rejoin_after_leave) config option.
    75  * `-retry-interval`: Equivalent to the [retry_interval](#retry_interval) config option.
    76  *   `-retry-join`: Similar to `-join` but allows retrying a join if the first attempt fails.
    77  
    78      ```sh
    79    $ nomad agent -retry-join "127.0.0.1:4648"
    80    ```
    81  
    82      `retry-join` can be defined as a command line flag only for servers. Clients
    83    can configure `retry-join` only in configuration files.
    84  
    85  * `-retry-max`: Similar to the [retry_max](#retry_max) config option.
    86  * `-server`: Enable server mode on the local agent.
    87  * `-servers=<host:port>`: Equivalent to the Client [servers](#servers) config
    88    option.
    89  * `-state-dir=<path>`: Equivalent to the Client [state_dir](#state_dir) config
    90    option.
    91  * `-vault-enabled`: Whether to enable or disabled Vault integration.
    92  * `-vault-address=<addr>`: The address to communicate with Vault.
    93  * `-vault-token=<token>`: The Vault token used to derive tokens. Only needs to
    94    be set on Servers. Overrides the Vault token read from the VAULT_TOKEN
    95    environment variable.
    96  * `-vault-create-from-role=<role>`: The role name to create tokens for tasks from.
    97  * `-vault-ca-file=<path>`: Path to a PEM-encoded CA cert file used to verify the
    98    Vault server SSL certificate.
    99  * `-vault-ca-path=<path>`: Path to a directory of PEM-encoded CA cert files used
   100    to verify the Vault server SSL certificate.Whether to enable or disabled Vault
   101    integration.
   102  * `vault-cert-file=<path>`: The path to the certificate for Vault communication.
   103  * `vault-key-file=<path>`: The path to the private key for Vault communication.
   104  * `vault-namespace=<namespace>`: The Vault namespace used for the integration.
   105    Required for servers and clients. Overrides the Vault namespace read from the 
   106    VAULT_NAMESPACE environment variable.  
   107  * `vault-tls-skip-verify`: A boolean that determines whether to skip SSL
   108    certificate verification.
   109  * `vault-tls-server-name=<name>`: Used to set the SNI host when connecting to
   110    Vault over TLS.