github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/website/pages/docs/commands/agent.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: 'Commands: agent'
     4  sidebar_title: agent
     5  description: |
     6    The agent command is the main entrypoint to running a Nomad client or server.
     7  ---
     8  
     9  # Command: agent
    10  
    11  The agent command is the heart of Nomad: it runs the agent that handles client
    12  or server functionality, including exposing interfaces for client consumption
    13  and running jobs.
    14  
    15  Due to the power and flexibility of this command, the Nomad agent is documented
    16  in its own section. See the [Nomad Agent] guide and the [Configuration]
    17  documentation section for more information on how to use this command and the
    18  options it has.
    19  
    20  ## Command-line Options
    21  
    22  A subset of the available Nomad agent configuration can optionally be passed in
    23  via CLI arguments. The `agent` command accepts the following arguments:
    24  
    25  - `-alloc-dir=<path>`: Equivalent to the Client [alloc_dir] config
    26    option.
    27  
    28  - `-acl-enabled`: Equivalent to the ACL [enabled] config option.
    29  
    30  - `-acl-replication-token`: Equivalent to the ACL [replication_token] config
    31    option.
    32  
    33  - `-bind=<address>`: Equivalent to the [bind_addr] config option.
    34  
    35  - `-bootstrap-expect=<num>`: Equivalent to the
    36    [bootstrap_expect] config option.
    37  
    38  - `-client`: Enable client mode on the local agent.
    39  
    40  - `-config=<path>`: Specifies the path to a configuration file or a directory of
    41    configuration files to load. Can be specified multiple times.
    42  
    43  - `-consul-address=<addr>`: Equivalent to the [address] config option.
    44  
    45  - `-consul-auth=<auth>`: Equivalent to the [auth] config option.
    46  
    47  - `-consul-auto-advertise`: Equivalent to the [auto_advertise] config option.
    48  
    49  - `-consul-ca-file=<path>`: Equivalent to the [ca_file] config option.
    50  
    51  - `-consul-cert-file=<path>`: Equivalent to the [cert_file] config option.
    52  
    53  - `-consul-checks-use-advertise`: Equivalent to the [checks_use_advertise]
    54    config option.
    55  
    56  - `-consul-client-auto-join`: Equivalent to the [client_auto_join] config
    57    option.
    58  
    59  - `-consul-client-service-name=<name>`: Equivalent to the [client_service_name]
    60    config option.
    61  
    62  - `-consul-client-http-check-name=<name>`: Equivalent to the
    63    [client_http_check_name] config option.
    64  
    65  - `-consul-key-file=<path>`: Equivalent to the [key_file] config option.
    66  
    67  - `-consul-server-service-name=<name>`: Equivalent to the [server_service_name]
    68    config option.
    69  
    70  - `-consul-server-http-check-name=<name>`: Equivalent to the
    71    [server_http_check_name] config option.
    72  
    73  - `-consul-server-serf-check-name=<name>`: Equivalent to the
    74    [server_serf_check_name] config option.
    75  
    76  - `-consul-server-rpc-check-name=<name>`: Equivalent to the
    77    [server_rpc_check_name] config option.
    78  
    79  - `-consul-server-auto-join`: Equivalent to the [server_auto_join] config
    80    option.
    81  
    82  - `-consul-ssl`: Equivalent to the [ssl] config option.
    83  
    84  - `-consul-token=<token>`: Equivalent to the [token] config option.
    85  
    86  - `-consul-verify-ssl`: Equivalent to the [verify_ssl] config option.
    87  
    88  - `-data-dir=<path>`: Equivalent to the [data_dir] config option.
    89  
    90  - `-dc=<datacenter>`: Equivalent to the [datacenter] config option.
    91  
    92  - `-dev`: Start the agent in development mode. This enables a pre-configured
    93    dual-role agent (client + server) which is useful for developing or testing
    94    Nomad. No other configuration is required to start the agent in this mode,
    95    but you may pass an optional comma-separated list of mode configurations:
    96  
    97  - `-dev-connect`: Start the agent in development mode, but bind to a public
    98    network interface rather than localhost for using Consul Connect. This mode
    99    is supported only on Linux as root.
   100  
   101  - `-encrypt`: Set the Serf encryption key. See the [Encryption Overview] for
   102    more details.
   103  
   104  - `-join=<address>`: Address of another agent to join upon starting up. This can
   105    be specified multiple times to specify multiple agents to join.
   106  
   107  - `-log-level=<level>`: Equivalent to the [log_level] config option.
   108  
   109  - `-log-json`: Equivalent to the [log_json] config option.
   110  
   111  - `-meta=<key=value>`: Equivalent to the Client [meta] config option.
   112  
   113  - `-network-interface=<interface>`: Equivalent to the Client
   114    [network_interface] config option.
   115  
   116  - `-network-speed=<MBits>`: Equivalent to the Client
   117    [network_speed] config option.
   118  
   119  - `-node=<name>`: Equivalent to the [name] config option.
   120  
   121  - `-node-class=<class>`: Equivalent to the Client [node_class]
   122    config option.
   123  
   124  - `-plugin-dir=<path>`: Equivalent to the [plugin_dir] config option.
   125  
   126  - `-region=<region>`: Equivalent to the [region] config option.
   127  
   128  - `-rejoin`: Equivalent to the [rejoin_after_leave] config option.
   129  
   130  - `-retry-interval`: Equivalent to the [retry_interval] config option.
   131  
   132  - `-retry-join`: Similar to `-join` but allows retrying a join if the first
   133    attempt fails.
   134  
   135    ```sh
   136    $ nomad agent -retry-join "127.0.0.1:4648"
   137    ```
   138  
   139    `retry-join` can be defined as a command line flag only for servers. Clients
   140    can configure `retry-join` only in configuration files.
   141  
   142  - `-retry-max`: Similar to the [retry_max] config option.
   143  
   144  - `-server`: Enable server mode on the local agent.
   145  
   146  - `-servers=<host:port>`: Equivalent to the Client [servers] config
   147    option.
   148  
   149  - `-state-dir=<path>`: Equivalent to the Client [state_dir] config
   150    option.
   151  
   152  - `-vault-enabled`: Whether to enable or disabled Vault integration.
   153  
   154  - `-vault-address=<addr>`: The address to communicate with Vault.
   155  
   156  - `-vault-token=<token>`: The Vault token used to derive tokens. Only needs to
   157    be set on Servers. Overrides the Vault token read from the VAULT_TOKEN
   158    environment variable.
   159  
   160  - `-vault-create-from-role=<role>`: The role name to create tokens for tasks
   161    from.
   162  
   163  - `-vault-ca-file=<path>`: Path to a PEM-encoded CA cert file used to verify the
   164    Vault server SSL certificate.
   165  
   166  - `-vault-ca-path=<path>`: Path to a directory of PEM-encoded CA cert files used
   167    to verify the Vault server SSL certificate.Whether to enable or disabled Vault
   168    integration.
   169  
   170  - `vault-cert-file=<path>`: The path to the certificate for Vault communication.
   171  
   172  - `vault-key-file=<path>`: The path to the private key for Vault communication.
   173  
   174  - `vault-namespace=<namespace>`: The Vault namespace used for the integration.
   175    Required for servers and clients. Overrides the Vault namespace read from the
   176    VAULT_NAMESPACE environment variable.
   177  
   178  - `vault-tls-skip-verify`: A boolean that determines whether to skip SSL
   179    certificate verification.
   180  
   181  - `vault-tls-server-name=<name>`: Used to set the SNI host when connecting to
   182    Vault over TLS.
   183  
   184  [address]: /docs/configuration/consul#address
   185  [alloc_dir]: /docs/configuration/client/#alloc_dir
   186  [auth]: /docs/configuration/consul#auth
   187  [auto_advertise]: /docs/configuration/consul#auto_advertise
   188  [bind_addr]: /docs/configuration/#bind_addr
   189  [bootstrap_expect]: /docs/configuration/server/#bootstrap_expect
   190  [ca_file]: /docs/configuration/consul#ca_file
   191  [cert_file]: /docs/configuration/consul#cert_file
   192  [checks_use_advertise]: /docs/configuration/consul#checks_use_advertise
   193  [client_auto_join]: /docs/configuration/consul#client_auto_join
   194  [client_http_check_name]: /docs/configuration/consul#client_http_check_name
   195  [client_service_name]: /docs/configuration/consul#client_service_name
   196  [configuration]: /docs/configuration
   197  [data_dir]: /docs/configuration#data_dir
   198  [datacenter]: /docs/configuration/#datacenter
   199  [enabled]: /docs/configuration/acl#enabled
   200  [encryption overview]: https://learn.hashicorp.com/nomad/transport-security/gossip-encryption
   201  [key_file]: /docs/configuration/consul#key_file
   202  [log_json]: /docs/configuration#log_json
   203  [log_level]: /docs/configuration#log_level
   204  [meta]: /docs/configuration/client/#meta
   205  [name]: /docs/configuration/#name
   206  [network_interface]: /docs/configuration/client/#network_interface
   207  [network_speed]: /docs/configuration/client/#network_speed
   208  [node_class]: /docs/configuration/client/#node_class
   209  [nomad agent]: /docs/install/production/nomad-agent
   210  [plugin_dir]: /docs/configuration#plugin_dir
   211  [region]: /docs/configuration/#region
   212  [rejoin_after_leave]: /docs/configuration/server/#rejoin_after_leave
   213  [replication_token]: /docs/configuration/acl#replication_token
   214  [retry_interval]: /docs/configuration/server/#retry_interval
   215  [retry_max]: /docs/configuration/server/#retry_max
   216  [server_auto_join]: /docs/configuration/consul#server_auto_join
   217  [server_http_check_name]: /docs/configuration/consul#server_http_check_name
   218  [server_rpc_check_name]: /docs/configuration/consul#server_rpc_check_name
   219  [server_serf_check_name]: /docs/configuration/consul#server_serf_check_name
   220  [server_service_name]: /docs/configuration/consul#server_service_name
   221  [servers]: /docs/configuration/client/#servers
   222  [ssl]: /docs/configuration/consul#ssl
   223  [state_dir]: /docs/configuration/client/#state_dir
   224  [token]: /docs/configuration/consul#token
   225  [verify_ssl]: /docs/configuration/consul#verify_ssl