github.com/quite/nomad@v0.8.6/website/source/docs/agent/configuration/server_join.html.md (about)

     1  ---
     2  layout: "docs"
     3  page_title: "server_join Stanza - Agent Configuration"
     4  sidebar_current: "docs-agent-configuration--server-join"
     5  description: |-
     6    The "server_join" stanza specifies how the Nomad agent will discover and connect to Nomad servers.
     7  ---
     8  
     9  # `server_join` Stanza
    10  
    11  <table class="table table-bordered table-striped">
    12    <tr>
    13      <th width="120">Placement</th>
    14      <td>
    15        <code>server -> **server_join**</code>
    16        <br>
    17        <code>client -> **server_join**</code>
    18      </td>
    19    </tr>
    20  </table>
    21  
    22  The `server_join` stanza specifies how the Nomad agent will discover and connect
    23  to Nomad servers.
    24  
    25  ```hcl
    26  server_join {
    27    retry_join = [ "1.1.1.1", "2.2.2.2" ]
    28    retry_max = 3
    29    retry_interval = "15s"
    30  }
    31  ```
    32  
    33  ## `server_join` Parameters
    34  
    35  -   `retry_join` `(array<string>: [])` - Specifies a list of server addresses to
    36    join. This is similar to [`start_join`](#start_join), but will continue to
    37    be attempted even if the initial join attempt fails, up to
    38    [retry_max](#retry_max). Further, `retry_join` is available to
    39    both Nomad servers and clients, while `start_join` is only defined for Nomad
    40    servers.  This is useful for cases where we know the address will become
    41    available eventually.  Use `retry_join` with an array as a replacement for
    42    `start_join`, **do not use both options**.
    43  
    44      Address format includes both using IP addresses as well as an interface to the
    45    [go-discover](https://github.com/hashicorp/go-discover) library for doing
    46    automated cluster joining using cloud metadata. See [Cloud
    47    Auto-join][cloud_auto_join] for more information.
    48  
    49      ```
    50    server_join {
    51      retry_join = [ "1.1.1.1", "2.2.2.2" ]
    52    }
    53    ```
    54  
    55      Using the `go-discover` interface, this can be defined both in a client or
    56    server configuration as well as provided as a command-line argument.
    57  
    58      ```
    59    server_join {
    60      retry_join = [ "provider=aws tag_key=..." ]
    61    }
    62    ```
    63  
    64      See the [server address format](#server-address-format) for more information
    65    about expected server address formats.
    66  
    67  - `retry_interval` `(string: "30s")` - Specifies the time to wait between retry
    68    join attempts.
    69  
    70  - `retry_max` `(int: 0)` - Specifies the maximum number of join attempts to be
    71    made before exiting with a return code of 1. By default, this is set to 0
    72    which is interpreted as infinite retries.
    73  
    74  - `start_join` `(array<string>: [])` - Specifies a list of server addresses to
    75    join on startup. If Nomad is unable to join with any of the specified
    76    addresses, agent startup will fail. See the
    77    [server address format](#server-address-format) section for more information
    78    on the format of the string. This field is defined only for Nomad servers and
    79    will result in a configuration parse error if included in a client
    80    configuration.
    81  
    82  ## Server Address Format
    83  
    84  This section describes the acceptable syntax and format for describing the
    85  location of a Nomad server. There are many ways to reference a Nomad server,
    86  including directly by IP address and resolving through DNS.
    87  
    88  ### Directly via IP Address
    89  
    90  It is possible to address another Nomad server using its IP address. This is
    91  done in the `ip:port` format, such as:
    92  
    93  ```
    94  1.2.3.4:5678
    95  ```
    96  
    97  If the port option is omitted, it defaults to the Serf port, which is 4648
    98  unless configured otherwise:
    99  
   100  ```
   101  1.2.3.4 => 1.2.3.4:4648
   102  ```
   103  
   104  ### Via Domains or DNS
   105  
   106  It is possible to address another Nomad server using its DNS address. This is
   107  done in the `address:port` format, such as:
   108  
   109  ```
   110  nomad-01.company.local:5678
   111  ```
   112  
   113  If the port option is omitted, it defaults to the Serf port, which is 4648
   114  unless configured otherwise:
   115  
   116  ```
   117  nomad-01.company.local => nomad-01.company.local:4648
   118  ```
   119  
   120  ### Via the go-discover interface
   121  
   122  As of Nomad 0.8.4, `retry_join` accepts a unified interface using the
   123  [go-discover](https://github.com/hashicorp/go-discover) library for doing
   124  automated cluster joining using cloud metadata. See [Cloud
   125  Auto-join][cloud_auto_join] for more information.
   126  
   127  ```
   128  "provider=aws tag_key=..." => 1.2.3.4:4648
   129  ```
   130  
   131  [cloud_auto_join]: /docs/agent/cloud_auto_join.html "Nomad Cloud Auto-join"