github.com/mattyr/nomad@v0.3.3-0.20160919021406-3485a065154a/website/source/docs/agent/config.html.md (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Configuration"
     4  sidebar_current: "docs-agent-config"
     5  description: |-
     6    Learn about the configuration options available for the Nomad agent.
     7  ---
     8  
     9  # Configuration
    10  
    11  Nomad agents have a variety of options that can be specified via configuration
    12  files or command-line flags. Config files must be written in
    13  [HCL](https://github.com/hashicorp/hcl) or JSON syntax. Nomad can read and
    14  combine options from multiple configuration files or directories to configure
    15  the Nomad agent.
    16  
    17  ## Loading Configuration Files
    18  
    19  When specifying multiple config file options on the command-line, the files are
    20  loaded in the order they are specified. For example:
    21  
    22      nomad agent -config server.conf -config /etc/nomad -config extra.json
    23  
    24  Will load configuration from `server.conf`, from `.hcl` and `.json` files under
    25  `/etc/nomad`, and finally from `extra.json`.
    26  
    27  Configuration files in directories are loaded alphabetically. With the
    28  directory option, only files ending with the `.hcl` or `.json` extensions are
    29  used. Directories are not loaded recursively.
    30  
    31  As each file is processed, its contents are merged into the existing
    32  configuration. When merging, any non-empty values from the latest config file
    33  will append or replace options in the current configuration. An empty value
    34  means `""` for strings, `0` for integer or float values, and `false` for
    35  booleans. Since empty values are ignored you cannot disable an option like
    36  server mode once you've enabled it.
    37  
    38  Complex data types like arrays or maps are usually merged. [Some configuration
    39  options](#cli) can also be specified using the command-line interface. Please
    40  refer to the sections below for the details of each option.
    41  
    42  ## Configuration Syntax
    43  
    44  The preferred configuration syntax is HCL, which supports comments, but you can
    45  also use JSON. Below is an example configuration file in HCL syntax.
    46  
    47  ```
    48  bind_addr = "0.0.0.0"
    49  data_dir = "/var/lib/nomad"
    50  
    51  advertise {
    52    # We need to specify our host's IP because we can't
    53    # advertise 0.0.0.0 to other nodes in our cluster.
    54    rpc = "1.2.3.4:4647"
    55  }
    56  
    57  server {
    58    enabled = true
    59    bootstrap_expect = 3
    60  }
    61  
    62  client {
    63    enabled = true
    64    network_speed = 10
    65    options {
    66      "driver.raw_exec.enable" = "1"
    67    }
    68  }
    69  
    70  consul {
    71      # Consul's HTTP Address
    72      address = "1.2.3.4:8500"
    73  }
    74  
    75  atlas {
    76    infrastructure = "hashicorp/mars"
    77    token = "atlas.v1.AFE84330943"
    78  }
    79  ```
    80  
    81  Note that it is strongly recommended _not_ to operate a node as both `client`
    82  and `server`, although this is supported to simplify development and testing.
    83  
    84  ## General Options
    85  
    86  The following configuration options are available to both client and server
    87  nodes, unless otherwise specified:
    88  
    89  * <a id="region">`region`</a>: Specifies the region the Nomad agent is a
    90    member of. A region typically maps to a geographic region, for example `us`,
    91    with potentially multiple zones, which map to [datacenters](#datacenter) such
    92    as `us-west` and `us-east`. Defaults to `global`.
    93  
    94  * `datacenter`: Datacenter of the local agent. All members of a datacenter
    95    should share a local LAN connection. Defaults to `dc1`.
    96  
    97  * <a id="name">`name`</a>: The name of the local node. This value is used to
    98    identify individual nodes in a given datacenter and must be unique
    99    per-datacenter. By default this is set to the local host's name.
   100  
   101  * `data_dir`: A local directory used to store agent state. Client nodes use this
   102    directory by default to store temporary allocation data as well as cluster
   103    information. Server nodes use this directory to store cluster state, including
   104    the replicated log and snapshot data. This option is required to start the
   105    Nomad agent and must be specified as an absolute path.
   106  
   107  * `log_level`: Controls the verbosity of logs the Nomad agent will output. Valid
   108    log levels include `WARN`, `INFO`, or `DEBUG` in increasing order of
   109    verbosity. Defaults to `INFO`.
   110  
   111  * <a id="bind_addr">`bind_addr`</a>: Used to indicate which address the Nomad
   112    agent should bind to for network services, including the HTTP interface as
   113    well as the internal gossip protocol and RPC mechanism. This should be
   114    specified in IP format, and can be used to easily bind all network services to
   115    the same address. It is also possible to bind the individual services to
   116    different addresses using the [addresses](#addresses) configuration option.
   117    Defaults to the local loopback address `127.0.0.1`.
   118  
   119  * `enable_debug`: Enables the debugging HTTP endpoints. These endpoints can be
   120    used with profiling tools to dump diagnostic information about Nomad's
   121    internals. It is not recommended to leave this enabled in production
   122    environments. Defaults to `false`.
   123  
   124  * `ports`: Controls the network ports used for different services required by
   125    the Nomad agent. The value is a key/value mapping of port numbers, and accepts
   126    the following keys:
   127    <br>
   128    * `http`: The port used to run the HTTP server. Applies to both client and
   129      server nodes. Defaults to `4646`.
   130    * `rpc`: The port used for internal RPC communication between agents and
   131      servers, and for inter-server traffic for the consensus algorithm (raft).
   132      Defaults to `4647`. Only used on server nodes.
   133    * `serf`: The port used for the gossip protocol for cluster membership. Both
   134      TCP and UDP should be routable between the server nodes on this port.
   135      Defaults to `4648`. Only used on server nodes.
   136  
   137  * <a id="addresses">`addresses`</a>: Controls the bind address for individual
   138    network services. Any values configured in this block take precedence over the
   139    default [bind_addr](#bind_addr). The value is a map of IP addresses and
   140    supports the following keys:
   141    <br>
   142    * `http`: The address the HTTP server is bound to. This is the most common
   143      bind address to change. Applies to both clients and servers.
   144    * `rpc`: The address to bind the internal RPC interfaces to. Should be exposed
   145      only to other cluster members if possible. Used only on server nodes, but
   146      must be accessible from all agents.
   147    * `serf`: The address used to bind the gossip layer to. Both a TCP and UDP
   148      listener will be exposed on this address. Should be restricted to only
   149      server nodes from the same datacenter if possible. Used only on server
   150      nodes.
   151  
   152  * `advertise`: Controls the advertise address for individual network services.
   153    This can be used to advertise a different address to the peers of a server or
   154    a client node to support more complex network configurations such as NAT. This
   155    configuration is optional, and defaults to the bind address of the specific
   156    network service if it is not provided. The value is a map of IP addresses and
   157    ports and supports the following keys:
   158    <br>
   159    * `http`: The address to advertise for the HTTP interface. This should be
   160      reachable by all the nodes from which end users are going to use the Nomad
   161      CLI tools.
   162      ```
   163      advertise {
   164         http = "1.2.3.4:4646"
   165      }
   166      ```
   167    * `rpc`: The address to advertise for the RPC interface. This address should
   168      be reachable by all of the agents in the cluster. For example:
   169      ```
   170      advertise {
   171        rpc = "1.2.3.4:4647"
   172      }
   173      ```
   174    * `serf`: The address advertised for the gossip layer. This address must be
   175      reachable from all server nodes. It is not required that clients can reach
   176      this address.
   177  
   178  * `consul`: The `consul` configuration block changes how Nomad interacts with
   179    Consul. Nomad can automatically advertise Nomad services via Consul, and can
   180    automatically bootstrap itself using Consul. For more details see the [`consul`
   181    section](#consul_options).
   182  
   183  <a id="telemetry_config"></a>
   184  
   185  * `telemetry`: Used to control how the Nomad agent exposes telemetry data to
   186    external metrics collection servers. This is a key/value mapping and supports
   187    the following keys:
   188    <br>
   189    * `statsite_address`: Address of a
   190      [statsite](https://github.com/armon/statsite) server to forward metrics data
   191      to.
   192    * `statsd_address`: Address of a [statsd](https://github.com/etsy/statsd)
   193      server to forward metrics to.
   194    * `disable_hostname`: A boolean indicating if gauge values should not be
   195      prefixed with the local hostname.
   196    * `publish_allocation_metrics`: Enables publishing runtime metrics of
   197      allocations. Default is `false`.
   198    * `publish_node_metrics`: Enables publishing runtime metrics of nodes. Default
   199      is `false`.
   200    * `circonus_api_token`
   201      A valid [Circonus](http://circonus.com/) API Token used to create/manage check. If provided, metric management is enabled.
   202    * `circonus_api_app`
   203      A valid app name associated with the API token. By default, this is set to "consul".
   204    * `circonus_api_url`
   205      The base URL to use for contacting the Circonus API. By default, this is set to "https://api.circonus.com/v2".
   206    * `circonus_submission_interval`
   207      The interval at which metrics are submitted to Circonus. By default, this is set to "10s" (ten seconds).
   208    * `circonus_submission_url`
   209      The `check.config.submission_url` field, of a Check API object, from a previously created HTTPTRAP check.
   210    * `circonus_check_id`
   211      The Check ID (not **check bundle**) from a previously created HTTPTRAP check. The numeric portion of the `check._cid` field in the Check API object.
   212    * `circonus_check_force_metric_activation`
   213      Force activation of metrics which already exist and are not currently active. If check management is enabled, the default behavior is to add new metrics as they are encountered. If the metric already exists in the check, it will **not** be activated. This setting overrides that behavior. By default, this is set to "false".
   214    * `circonus_check_instance_id`
   215      Serves to uniquely identify the metrics coming from this *instance*.  It can be used to maintain metric continuity with transient or ephemeral instances as they move around within an infrastructure. By default, this is set to hostname:application name (e.g. "host123:consul").
   216    * `circonus_check_search_tag`
   217      A special tag which, when coupled with the instance id, helps to narrow down the search results when neither a Submission URL or Check ID is provided. By default, this is set to service:app (e.g. "service:consul").
   218    * `circonus_broker_id`
   219      The ID of a specific Circonus Broker to use when creating a new check. The numeric portion of `broker._cid` field in a Broker API object. If metric management is enabled and neither a Submission URL nor Check ID is provided, an attempt will be made to search for an existing check using Instance ID and Search Tag. If one is not found, a new HTTPTRAP check will be created. By default, this is not used and a random Enterprise Broker is selected, or, the default Circonus Public Broker.
   220    * `circonus_broker_select_tag`
   221      A special tag which will be used to select a Circonus Broker when a Broker ID is not provided. The best use of this is to as a hint for which broker should be used based on *where* this particular instance is running (e.g. a specific geo location or datacenter, dc:sfo). By default, this is not used.
   222  
   223  * `leave_on_interrupt`: Enables gracefully leaving when receiving the
   224    interrupt signal. By default, the agent will exit forcefully on any signal.
   225  
   226  * `leave_on_terminate`: Enables gracefully leaving when receiving the
   227    terminate signal. By default, the agent will exit forcefully on any signal.
   228  
   229  * `enable_syslog`: Enables logging to syslog. This option only works on
   230    Unix based systems.
   231  
   232  * `syslog_facility`: Controls the syslog facility that is used. By default,
   233    `LOCAL0` will be used. This should be used with `enable_syslog`.
   234  
   235  * `disable_update_check`: Disables automatic checking for security bulletins
   236    and new version releases.
   237  
   238  * `disable_anonymous_signature`: Disables providing an anonymous signature
   239    for de-duplication with the update check. See `disable_update_check`.
   240  
   241  * `http_api_response_headers`: This object allows adding headers to the
   242    HTTP API responses. For example, the following config can be used to enable
   243    CORS on the HTTP API endpoints:
   244    ```
   245    http_api_response_headers {
   246        Access-Control-Allow-Origin = "*"
   247    }
   248    ```
   249  
   250  * `atlas`: See the [`atlas` options](#atlas_options) for more details.
   251  
   252  ## <a id="consul_options"></a>Consul Options
   253  
   254  The following options are used to configure [Consul](https://www.consul.io)
   255  integration and are entirely optional.
   256  
   257  * `consul`: The top-level config key used to contain all Consul-related
   258    configuration options. The value is a key/value map which supports the
   259    following keys:
   260    <br>
   261    * `address`: The address to the local Consul agent given in the format of
   262      `host:port`. Defaults to `127.0.0.1:8500`, which is the same as the Consul
   263      default HTTP address.
   264  
   265    * `token`: Token is used to provide a per-request ACL token. This options
   266      overrides the Consul Agent's default token.
   267  
   268    * `auth`: The auth information to use for http access to the Consul Agent
   269      given as `username:password`.
   270  
   271    * `ssl`: This boolean option sets the transport scheme to talk to the Consul
   272      Agent as `https`. Defaults to `false`.
   273  
   274    * `verify_ssl`: This option enables SSL verification when the transport
   275      scheme for the Consul API client is `https`. Defaults to `true`.
   276  
   277    * `ca_file`: Optional path to the CA certificate used for Consul
   278      communication, defaults to the system bundle if not specified.
   279  
   280    * `cert_file`: The path to the certificate used for Consul communication. If
   281      this is set then you need to also set `key_file`.
   282  
   283    * `key_file`: The path to the private key used for Consul communication. If
   284      this is set then you need to also set `cert_file`.
   285  
   286    * `server_service_name`: The name of the service that Nomad registers servers
   287      with. Defaults to `nomad`.
   288  
   289    * `client_service_name`: The name of the service that Nomad registers clients
   290      with. Defaults to `nomad-client`.
   291  
   292    * `auto_advertise`: When enabled Nomad advertises its services to Consul. The
   293      services are named according to `server_service_name` and
   294      `client_service_name`. Nomad Servers and Clients advertise their respective
   295      services, each tagged appropriately with either `http` or `rpc` tag. Nomad
   296      Servers also advertise a `serf` tagged service.  Defaults to `true`.  
   297  
   298    * `server_auto_join`: Servers will automatically discover and join other
   299      Nomad Servers by searching for the Consul service name defined in the
   300      `server_service_name` option. This search only happens if the Server does
   301      not have a leader. Defaults to `true`.
   302  
   303    * `client_auto_join`:  Client will automatically discover Servers in the
   304      Client's region by searching for the Consul service name defined in the
   305      `server_service_name` option. The search occurs if the Client is not
   306      registered with any Servers or it is unable to heartbeat to the leader of
   307      the region, in which case it may be partitioned and searches for other
   308      Servers. Defaults to `true`
   309  
   310  When `server_auto_join`, `client_auto_join` and `auto_advertise` are all
   311  enabled, which is by default, and Consul is available, the Nomad cluster will
   312  self-bootstrap.
   313  
   314  ## <a id="atlas_options"></a>Atlas Options
   315  
   316  **NOTE**: Nomad integration with Atlas is awaiting release of Atlas features
   317  for Nomad support.  Nomad currently only validates configuration options for
   318  Atlas but does not use them.
   319  See [#183](https://github.com/hashicorp/nomad/issues/183) for more details.
   320  
   321  The following options are used to configure [Atlas](https://atlas.hashicorp.com)
   322  integration and are entirely optional.
   323  
   324  * `atlas`: The top-level config key used to contain all Atlas-related
   325    configuration options. The value is a key/value map which supports the
   326    following keys:
   327    <br>
   328    * <a id="infrastructure">`infrastructure`</a>: The Atlas infrastructure name to
   329      connect this agent to. This value should be of the form
   330      `<org>/<infrastructure>`, and requires a valid [token](#token) authorized on
   331      the infrastructure.
   332    * <a id="token">`token`</a>: The Atlas token to use for authentication. This
   333      token should have access to the provided [infrastructure](#infrastructure).
   334    * <a id="join">`join`</a>: A boolean indicating if the auto-join feature of
   335      Atlas should be enabled. Defaults to `false`.
   336    * `endpoint`: The address of the Atlas instance to connect to. Defaults to the
   337      public Atlas endpoint and is only used if both
   338      [infrastructure](#infrastructure) and [token](#token) are provided.
   339  
   340  
   341  ## Server-specific Options
   342  
   343  The following options are applicable to server agents only and need not be
   344  configured on client nodes.
   345  
   346  * `server`: This is the top-level key used to define the Nomad server
   347    configuration. It is a key/value mapping which supports the following keys:
   348    <br>
   349    * `enabled`: A boolean indicating if server mode should be enabled for the
   350      local agent. All other server options depend on this value being set.
   351      Defaults to `false`.
   352    * <a id="bootstrap_expect">`bootstrap_expect`</a>: This is an integer
   353      representing the number of server nodes to wait for before bootstrapping. It
   354      is most common to use the odd-numbered integers `3` or `5` for this value,
   355      depending on the cluster size. A value of `1` does not provide any fault
   356      tolerance and is not recommended for production use cases.
   357    * `data_dir`: This is the data directory used for server-specific data,
   358      including the replicated log. By default, this directory lives inside of the
   359      [data_dir](#data_dir) in the "server" sub-path.
   360    * `protocol_version`: The Nomad protocol version spoken when communicating
   361      with other Nomad servers. This value is typically not required as the agent
   362      internally knows the latest version, but may be useful in some upgrade
   363      scenarios.
   364    * `num_schedulers`: The number of parallel scheduler threads to run. This
   365      can be as many as one per core, or `0` to disallow this server from making
   366      any scheduling decisions. This defaults to the number of CPU cores.
   367    * `enabled_schedulers`: This is an array of strings indicating which
   368      sub-schedulers this server will handle. This can be used to restrict the
   369      evaluations that worker threads will dequeue for processing. This
   370      defaults to all available schedulers.
   371    * `node_gc_threshold` This is a string with a unit suffix, such as "300ms",
   372      "1.5h" or "25m". Valid time units are "ns", "us" (or "µs"), "ms", "s",
   373      "m", "h". Controls how long a node must be in a terminal state before it is
   374      garbage collected and purged from the system.
   375    * <a id="rejoin_after_leave">`rejoin_after_leave`</a> When provided, Nomad will ignore a previous leave and
   376      attempt to rejoin the cluster when starting. By default, Nomad treats leave
   377      as a permanent intent and does not attempt to join the cluster again when
   378      starting. This flag allows the previous state to be used to rejoin the
   379      cluster.
   380    * <a id="retry_join">`retry_join`</a> Similar to [`start_join`](#start_join) but allows retrying a join
   381      if the first attempt fails. This is useful for cases where we know the
   382      address will become available eventually. Use `retry_join` with an array as a replacement for
   383      `start_join`, do not use both options.
   384    * <a id="retry_interval">`retry_interval`</a> The time to wait between join attempts. Defaults to 30s.
   385    * <a id="retry_max">`retry_max`</a> The maximum number of join attempts to be made before exiting
   386      with a return code of 1. By default, this is set to 0 which is interpreted
   387      as infinite retries.
   388    * <a id="start_join">`start_join`</a> An array of strings specifying addresses
   389      of nodes to join upon startup. If Nomad is unable to join with any of the
   390      specified addresses, agent startup will fail. By default, the agent won't
   391      join any nodes when it starts up. Addresses can be given as an IP, a domain
   392      name, or an IP:Port pair. If the port isn't specified the default Serf port,
   393      4648, is used.  DNS names may also be used.
   394  
   395  ## Client-specific Options
   396  
   397  The following options are applicable to client agents only and need not be
   398  configured on server nodes.
   399  
   400  * `client`: This is the top-level key used to define the Nomad client
   401    configuration. Like the server configuration, it is a key/value mapping which
   402    supports the following keys:
   403    <br>
   404    * `enabled`: A boolean indicating if client mode is enabled. All other client
   405      configuration options depend on this value. Defaults to `false`.
   406    * <a id="state_dir">`state_dir`</a>: This is the state dir used to store
   407      client state. By default, it lives inside of the [data_dir](#data_dir), in
   408      the "client" sub-path. It must be specified as an absolute path.
   409    * <a id="alloc_dir">`alloc_dir`</a>: A directory used to store allocation data.
   410      Depending on the workload, the size of this directory can grow arbitrarily
   411      large as it is used to store downloaded artifacts for drivers (QEMU images,
   412      JAR files, etc.). It is therefore important to ensure this directory is
   413      placed some place on the filesystem with adequate storage capacity. By
   414      default, this directory lives under the [data_dir](#data_dir) at the
   415      "alloc" sub-path. It must be specified as an absolute path.
   416    * <a id="servers">`servers`</a>: An array of server addresses. This list is
   417      used to register the client with the server nodes and advertise the
   418      available resources so that the agent can receive work. If a port is not specified
   419      in the array of server addresses, the default port `4647` will be used.
   420    * <a id="node_class">`node_class`</a>: A string used to logically group client
   421      nodes by class. This can be used during job placement as a filter. This
   422      option is not required and has no default.
   423    * <a id="meta">`meta`</a>: This is a key/value mapping of metadata pairs. This
   424      is a free-form map and can contain any string values.
   425    * <a id="options">`options`</a>: This is a key/value mapping of internal
   426      configuration for clients, such as for driver configuration. Please see
   427      [here](#options_map) for a description of available options.
   428    * <a id="chroot_env">`chroot_env`</a>: This is a key/value mapping that
   429      defines the chroot environment for jobs using the Exec and Java drivers.
   430      Please see [here](#chroot_env_map) for an example and further information.
   431    * <a id="network_interface">`network_interface`</a>: This is a string to force
   432      network fingerprinting to use a specific network interface
   433    * <a id="network_speed">`network_speed`</a>: This is an int that sets the
   434      default link speed of network interfaces, in megabits, if their speed can
   435      not be determined dynamically.
   436    * `max_kill_timeout`: `max_kill_timeout` is a time duration that can be
   437      specified using the `s`, `m`, and `h` suffixes, such as `30s`. If a job's
   438      task specifies a `kill_timeout` greater than `max_kill_timeout`,
   439      `max_kill_timeout` is used. This is to prevent a user being able to set an
   440      unreasonable timeout. If unset, a default is used.
   441  <a id="reserved"></a>
   442    * `reserved`: `reserved` is used to reserve a portion of the nodes resources
   443      from being used by Nomad when placing tasks.  It can be used to target
   444      a certain capacity usage for the node. For example, 20% of the nodes CPU
   445      could be reserved to target a CPU utilization of 80%. The block has the
   446      following format:
   447  
   448      ```
   449      reserved {
   450          cpu = 500
   451          memory = 512
   452          disk = 1024
   453          reserved_ports = "22,80,8500-8600"
   454      }
   455      ```
   456  
   457      * `cpu`: `cpu` is given as MHz to reserve.
   458      * `memory`: `memory` is given as MB to reserve.
   459      * `disk`: `disk` is given as MB to reserve.
   460      * `reserved_ports`: `reserved_ports` is a comma separated list of ports
   461        to reserve on all fingerprinted network devices. Ranges can be
   462        specified by using a hyphen separated the two inclusive ends.
   463  
   464  ### <a id="options_map"></a>Client Options Map
   465  
   466  The following is not an exhaustive list of options that can be passed to the
   467  Client, but rather the set of options that configure the Client and not the
   468  drivers. To find the options supported by an individual driver, see the drivers
   469  documentation [here](/docs/drivers/index.html)
   470  
   471  * `driver.whitelist`: A comma separated list of whitelisted drivers (e.g.
   472    "docker,qemu"). If specified, drivers not in the whitelist will be disabled.
   473    If the whitelist is empty, all drivers are fingerprinted and enabled where
   474    applicable.
   475  
   476  *   `env.blacklist`: Nomad passes the host environment variables to `exec`,
   477      `raw_exec` and `java` tasks. `env.blacklist` is a comma separated list of
   478      environment variable keys not to pass to these tasks. If specified, the
   479      defaults are overridden. The following are the default:
   480  
   481      * `CONSUL_TOKEN`
   482      * `VAULT_TOKEN`
   483      * `ATLAS_TOKEN`
   484      * `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN`
   485      * `GOOGLE_APPLICATION_CREDENTIALS`
   486  
   487  *   `user.blacklist`: An operator specifiable blacklist of users which a task is
   488      not allowed to run as when using a driver in `user.checked_drivers`.
   489      Defaults to:
   490  
   491      * `root`
   492      * `Administrator`
   493  
   494  *   `user.checked_drivers`: An operator specifiable list of drivers to enforce
   495      the the `user.blacklist`. For drivers using containers, this enforcement often
   496      doesn't make sense and as such the default is set to:
   497  
   498      * `exec`
   499      * `qemu`
   500      * `java`
   501  
   502  * `fingerprint.whitelist`: A comma separated list of whitelisted fingerprinters.
   503    If specified, fingerprinters not in the whitelist will be disabled. If the
   504    whitelist is empty, all fingerprinters are used.
   505  
   506  ### <a id="chroot_env_map"></a>Client ChrootEnv Map
   507  
   508  Drivers based on [Isolated Fork/Exec](/docs/drivers/exec.html) implement file
   509  system isolation using chroot on Linux.  The `chroot_env` map allows the chroot
   510  environment to be configured using source paths on the host operating system.
   511  The mapping format is: `source_path -> dest_path`.
   512  
   513  The following example specifies a chroot which contains just enough to run the
   514  `ls` utility, and not much else:
   515  
   516  ```
   517  chroot_env {
   518      "/bin/ls" = "/bin/ls"
   519      "/etc/ld.so.cache" = "/etc/ld.so.cache"
   520      "/etc/ld.so.conf" = "/etc/ld.so.conf"
   521      "/etc/ld.so.conf.d" = "/etc/ld.so.conf.d"
   522      "/lib" = "/lib"
   523      "/lib64" = "/lib64"
   524  }
   525  ```
   526  
   527  When `chroot_env` is unspecified, the `exec` driver will use a default chroot
   528  environment with the most commonly used parts of the operating system. See
   529  `exec` documentation for the full list [here](/docs/drivers/exec.html#chroot).
   530  
   531  ## <a id="cli"></a>Command-line Options
   532  
   533  A subset of the available Nomad agent configuration can optionally be passed in
   534  via CLI arguments. The `agent` command accepts the following arguments:
   535  
   536  * `alloc-dir=<path>`: Equivalent to the Client [alloc_dir](#alloc_dir) config
   537     option.
   538  * `-atlas=<infrastructure>`: Equivalent to the Atlas
   539    [infrastructure](#infrastructure) config option.
   540  * `-atlas-join`: Equivalent to the Atlas [join](#join) config option.
   541  * `-atlas-token=<token>`: Equivalent to the Atlas [token](#token) config option.
   542  * `-bind=<address>`: Equivalent to the [bind_addr](#bind_addr) config option.
   543  * `-bootstrap-expect=<num>`: Equivalent to the
   544    [bootstrap_expect](#bootstrap_expect) config option.
   545  * `-client`: Enable client mode on the local agent.
   546  * `-config=<path>`: Specifies the path to a configuration file or a directory of
   547    configuration files to load. Can be specified multiple times.
   548  * `-data-dir=<path>`: Equivalent to the [data_dir](#data_dir) config option.
   549  * `-dc=<datacenter>`: Equivalent to the [datacenter](#datacenter) config option.
   550  * `-dev`: Start the agent in development mode. This enables a pre-configured
   551    dual-role agent (client + server) which is useful for developing or testing
   552    Nomad. No other configuration is required to start the agent in this mode.
   553  * `-join=<address>`: Address of another agent to join upon starting up. This can
   554    be specified multiple times to specify multiple agents to join.
   555  * `-log-level=<level>`: Equivalent to the [log_level](#log_level) config option.
   556  * `-meta=<key=value>`: Equivalent to the Client [meta](#meta) config option.
   557  * `-network-interface<interface>`: Equivalent to the Client
   558     [network_interface](#network_interface) config option.
   559  * `-network-speed<MBits>`: Equivalent to the Client
   560    [network_speed](#network_speed) config option.
   561  * `-node=<name>`: Equivalent to the [name](#name) config option.
   562  * `-node-class=<class>`: Equivalent to the Client [node_class](#node_class)
   563    config option.
   564  * `-region=<region>`: Equivalent to the [region](#region) config option.
   565  * `-rejoin`: Equivalent to the [rejoin_after_leave](#rejoin_after_leave) config option.
   566  * `-retry-interval`: Equivalent to the [retry_interval](#retry_interval) config option.
   567  * `-retry-join`: Similar to `-join` but allows retrying a join if the first attempt fails.
   568  * `-retry-max`: Similar to the [retry_max](#retry_max) config option.
   569  * `-server`: Enable server mode on the local agent.
   570  * `-servers=<host:port>`: Equivalent to the Client [servers](#servers) config
   571    option.
   572  * `-state-dir=<path>`: Equivalent to the Client [state_dir](#state_dir) config
   573    option.