Stateful Workloads

Stateful Workloads Overview

Nomad allows users to mount persistent data from local or remote storage volumes into task environments in a couple of ways — host volume mounts or Docker volume drivers.

Nomad host volumes allow you to mount any directory on the Nomad client into an allocation. These directories can be simple directories on a client, but can also be a mounted filesystems like NFS or GlusterFS. These mounts can then be connected to individual tasks within a task group.

The Docker task driver's support for volumes enables Nomad to integrate with software-defined storage (SDS) solutions like Portworx to support stateful workloads. Please keep in mind that Nomad does not actually manage storage pools or replication as these tasks are delegated to the SDS providers. Please assess all factors and risks when utilizing such providers to run stateful workloads (such as your production database).

In these guides, we will deploy a MySQL Docker container to a Nomad cluster and demonstrate that the data is persisted beyond the life of the allocation.