github.com/anuvu/nomad@v0.8.7-atom1/website/source/docs/upgrade/upgrade-specific.html.md (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Upgrade Guides"
     4  sidebar_current: "docs-upgrade-specific"
     5  description: |-
     6    Specific versions of Nomad may have additional information about the upgrade
     7    process beyond the standard flow.
     8  ---
     9  
    10  # Upgrading Specific Versions
    11  
    12  The [upgrading page](/docs/upgrade/index.html) covers the details of doing
    13  a standard upgrade. However, specific versions of Nomad may have more
    14  details provided for their upgrades as a result of new features or changed
    15  behavior. This page is used to document those details separately from the
    16  standard upgrade flow.
    17  
    18  ## Nomad 0.8.0
    19  
    20  ### Raft Protocol Version Compatibility
    21  
    22  When upgrading to Nomad 0.8.0 from a version lower than 0.7.0, users will need
    23  to set the
    24  [`raft_protocol`](/docs/agent/configuration/server.html#raft_protocol) option
    25  in their `server` stanza to 1 in order to maintain backwards compatibility with
    26  the old servers during the upgrade.  After the servers have been migrated to
    27  version 0.8.0, `raft_protocol` can be moved up to 2 and the servers restarted
    28  to match the default.
    29  
    30  The Raft protocol must be stepped up in this way; only adjacent version numbers are
    31  compatible (for example, version 1 cannot talk to version 3). Here is a table of the
    32  Raft Protocol versions supported by each Nomad version:
    33  
    34  <table class="table table-bordered table-striped">
    35    <tr>
    36      <th>Version</th>
    37      <th>Supported Raft Protocols</th>
    38    </tr>
    39    <tr>
    40      <td>0.6 and earlier</td>
    41      <td>0</td>
    42    </tr>
    43    <tr>
    44      <td>0.7</td>
    45      <td>1</td>
    46    </tr>
    47    <tr>
    48      <td>0.8</td>
    49      <td>1, 2, 3</td>
    50    </tr>
    51  </table>
    52  
    53  In order to enable all [Autopilot](/guides/cluster/autopilot.html) features, all servers
    54  in a Nomad cluster must be running with Raft protocol version 3 or later.
    55  
    56  #### Upgrading to Raft Protocol 3
    57  
    58  This section provides details on upgrading to Raft Protocol 3 in Nomad 0.8 and higher. Raft protocol version 3 requires Nomad running 0.8.0 or newer on all servers in order to work. See [Raft Protocol Version Compatibility](/docs/upgrade/upgrade-specific.html#raft-protocol-version-compatibility) for more details. Also the format of `peers.json` used for outage recovery is different when running with the latest Raft protocol. See [Manual Recovery Using peers.json](/guides/outage.html#manual-recovery-using-peers-json) for a description of the required format.
    59  
    60  Please note that the Raft protocol is different from Nomad's internal protocol as shown in commands like `nomad server members`. To see the version of the Raft protocol in use on each server, use the `nomad operator raft list-peers` command.
    61  
    62  The easiest way to upgrade servers is to have each server leave the cluster, upgrade its `raft_protocol` version in the `server` stanza, and then add it back. Make sure the new server joins successfully and that the cluster is stable before rolling the upgrade forward to the next server. It's also possible to stand up a new set of servers, and then slowly stand down each of the older servers in a similar fashion.
    63  
    64  When using Raft protocol version 3, servers are identified by their `node-id` instead of their IP address when Nomad makes changes to its internal Raft quorum configuration. This means that once a cluster has been upgraded with servers all running Raft protocol version 3, it will no longer allow servers running any older Raft protocol versions to be added. If running a single Nomad server, restarting it in-place will result in that server not being able to elect itself as a leader. To avoid this, either set the Raft protocol back to 2, or use [Manual Recovery Using peers.json](/docs/guides/outage.html#manual-recovery-using-peers-json) to map the server to its node ID in the Raft quorum configuration.
    65  
    66  
    67  ### Node Draining Improvements
    68  
    69  Node draining via the [`node drain`][drain-cli] command or the [drain
    70  API][drain-api] has been substantially changed in Nomad 0.8. In Nomad 0.7.1 and
    71  earlier draining a node would immediately stop all allocations on the node
    72  being drained. Nomad 0.8 now supports a [`migrate`][migrate] stanza in job
    73  specifications to control how many allocations may be migrated at once and the
    74  default will be used for existing jobs.
    75  
    76  The `drain` command now blocks until the drain completes. To get the Nomad
    77  0.7.1 and earlier drain behavior use the command: `nomad node drain -enable
    78  -force -detach <node-id>`
    79  
    80  See the [`migrate` stanza documentation][migrate] and [Decommissioning Nodes
    81  guide](/guides/node-draining.html) for details.
    82  
    83  ### Periods in Environment Variable Names No Longer Escaped
    84  
    85  *Applications which expect periods in environment variable names to be replaced
    86  with underscores must be updated.*
    87  
    88  In Nomad 0.7 periods (`.`) in environment variables names were replaced with an
    89  underscore in both the [`env`](/docs/job-specification/env.html) and
    90  [`template`](/docs/job-specification/template.html) stanzas.
    91  
    92  In Nomad 0.8 periods are *not* replaced and will be included in environment
    93  variables verbatim.
    94  
    95  For example the following stanza:
    96  
    97  ```text
    98  env {
    99    registry.consul.addr = "${NOMAD_IP_http}:8500"
   100  }
   101  ```
   102  
   103  In Nomad 0.7 would be exposed to the task as
   104  `registry_consul_addr=127.0.0.1:8500`. In Nomad 0.8 it will now appear exactly
   105  as specified: `registry.consul.addr=127.0.0.1:8500`.
   106  
   107  ### Client APIs Unavailable on Older Nodes
   108  
   109  Because Nomad 0.8 uses a new RPC mechanism to route node-specific APIs like
   110  [`nomad alloc fs`](/docs/commands/alloc/fs.html) through servers to the node,
   111  0.8 CLIs are incompatible using these commands on clients older than 0.8.
   112  
   113  To access these commands on older clients either continue to use a pre-0.8
   114  version of the CLI, or upgrade all clients to 0.8.
   115  
   116  ### CLI Command Changes
   117  
   118  Nomad 0.8 has changed the organization of CLI commands to be based on
   119  subcommands. An example of this change is the change from `nomad alloc-status`
   120  to `nomad alloc status`. All commands have been made to be backwards compatible,
   121  but operators should update any usage of the old style commands to the new style
   122  as the old style will be deprecated in future versions of Nomad.
   123  
   124  ### RPC Advertise Address
   125  
   126  The behavior of the [advertised RPC
   127  address](/docs/agent/configuration/index.html#rpc-1) has changed to be only used
   128  to advertise the RPC address of servers to client nodes. Server to server
   129  communication is done using the advertised Serf address. Existing cluster's
   130  should not be effected but the advertised RPC address may need to be updated to
   131  allow connecting client's over a NAT.
   132  
   133  
   134  ## Nomad 0.6.0
   135  
   136  ### Default `advertise` address changes
   137  
   138  When no `advertise` address was specified and Nomad's `bind_addr` was loopback
   139  or `0.0.0.0`, Nomad attempted to resolve the local hostname to use as an
   140  advertise address.
   141  
   142  Many hosts cannot properly resolve their hostname, so Nomad 0.6 defaults
   143  `advertise` to the first private IP on the host (e.g. `10.1.2.3`).
   144  
   145  If you manually configure `advertise` addresses no changes are necessary.
   146  
   147  ## Nomad Clients
   148  
   149  The change to the default, advertised IP also effect clients that do not specify
   150  which network_interface to use. If you have several routable IPs, it is advised
   151  to configure the client's [network
   152  interface](https://www.nomadproject.io/docs/agent/configuration/client.html#network_interface)
   153  such that tasks bind to the correct address.
   154  
   155  ## Nomad 0.5.5
   156  
   157  ### Docker `load` changes
   158  
   159  Nomad 0.5.5 has a backward incompatible change in the `docker` driver's
   160  configuration. Prior to 0.5.5 the `load` configuration option accepted a list
   161  images to load, in 0.5.5 it has been changed to a single string. No
   162  functionality was changed. Even if more than one item was specified prior to
   163  0.5.5 only the first item was used.
   164  
   165  To do a zero-downtime deploy with jobs that use the `load` option:
   166  
   167  * Upgrade servers to version 0.5.5 or later.
   168  
   169  * Deploy new client nodes on the same version as the servers.
   170  
   171  * Resubmit jobs with the `load` option fixed and a constraint to only run on
   172    version 0.5.5 or later:
   173  
   174  ```hcl
   175      constraint {
   176        attribute = "${attr.nomad.version}"
   177        operator  = "version"
   178        value     = ">= 0.5.5"
   179      }
   180  ```
   181  
   182  * Drain and shutdown old client nodes.
   183  
   184  ### Validation changes
   185  
   186  Due to internal job serialization and validation changes you may run into
   187  issues using 0.5.5 command line tools such as `nomad run` and `nomad validate`
   188  with 0.5.4 or earlier agents.
   189  
   190  It is recommended you upgrade agents before or alongside your command line
   191  tools.
   192  
   193  ## Nomad 0.4.0
   194  
   195  Nomad 0.4.0 has backward incompatible changes in the logic for Consul
   196  deregistration.  When a Task which was started by Nomad v0.3.x is uncleanly shut
   197  down, the Nomad 0.4 Client will no longer clean up any stale services.  If an
   198  in-place upgrade of the Nomad client to 0.4 prevents the Task from gracefully
   199  shutting down and deregistering its Consul-registered services, the Nomad Client
   200  will not clean up the remaining Consul services registered with the 0.3
   201  Executor.
   202  
   203  We recommend draining a node before upgrading to 0.4.0 and then re-enabling the
   204  node once the upgrade is complete.
   205  
   206  
   207  ## Nomad 0.3.1
   208  
   209  Nomad 0.3.1 removes artifact downloading from driver configurations and places them as
   210  a first class element of the task. As such, jobs will have to be rewritten in
   211  the proper format and resubmitted to Nomad. Nomad clients will properly
   212  re-attach to existing tasks but job definitions must be updated before they can
   213  be dispatched to clients running 0.3.1.
   214  
   215  ## Nomad 0.3.0
   216  
   217  Nomad 0.3.0 has made several substantial changes to job files included a new
   218  `log` block and variable interpretation syntax (`${var}`), a modified `restart`
   219  policy syntax, and minimum resources for tasks as well as validation. These
   220  changes require a slight change to the default upgrade flow.
   221  
   222  After upgrading the version of the servers, all previously submitted jobs must
   223  be resubmitted with the updated job syntax using a Nomad 0.3.0 binary.
   224  
   225  * All instances of `$var` must be converted to the new syntax of `${var}`
   226  
   227  * All tasks must provide their required resources for CPU, memory and disk as
   228    well as required network usage if ports are required by the task.
   229  
   230  * Restart policies must be updated to indicate whether it is desired for the
   231    task to restart on failure or to fail using `mode = "delay"` or `mode =
   232    "fail"` respectively.
   233  
   234  * Service names that include periods will fail validation. To fix, remove any
   235    periods from the service name before running the job.
   236  
   237  After updating the Servers and job files, Nomad Clients can be upgraded by first
   238  draining the node so no tasks are running on it. This can be verified by running
   239  `nomad node status <node-id>` and verify there are no tasks in the `running`
   240  state. Once that is done the client can be killed, the `data_dir` should be
   241  deleted and then Nomad 0.3.0 can be launched.
   242  
   243  [drain-api]: /api/nodes.html#drain-node
   244  [drain-cli]: /docs/commands/node/drain.html
   245  [migrate]: /docs/job-specification/migrate.html