Docker is an open-source system for automating deployment, scaling, and management of containerized applications. Having captured the hearts and minds of developers with their simple API, they have been at the center of the container revolution and have grown their suite of tools into an enterprise-grade cluster management solution. Tools such as Docker Swarm and the Universal Control Plane allow the automated deployment of containers at scale. However, as enterprises adopt containers, they need a Docker persistent storage solution that provides HA, backups, snapshots, encryption, monitoring integration, and more. If you are thinking about running Docker stateful containers like MySQL, Cassandra, Redis, Postgres or any other stateful services, this guide to Docker storage is for you.
Problems with Docker persistent storage today:
- Volumes are pinned to a single host
- Storage resource requirements are fixed at start time
- Increasing your storage capacity without downtime is difficult
- Hard to provide HA, off-site backups, snapshots, & encryption
Install Portworx as a Swarm service
Getting started running stateful services on Docker is easy. Portworx can be installed directly via the Docker command line and will run as a Swarm global service. This method runs a Portworx container on each host and will create a cluster-wide storage fabric from your underlying block devices.
Use Portworx as Docker persistent storage for the most common stateful apps
DockerHub has official images for some of the most popular stateful services including MySQL, Cassandra, Redis and Postgres. You can easily run a stateful container from these images which will automatically provision storage using the underlying Portworx volume driver. You can also create a Distributed Application Bundle using Docker Compose that will deploy a Swarm service. Alongside Portworx, these images make it easy to deploy and manage stateful apps on Docker, eliminating nearly all of the complexity traditionally associated with running stateful services on these clusters.
Solutions to the most common Docker stateful container problems
Docker has given developers a powerful tool to bundle and distribute their code, which has many advantages for stateless applications. Many enterprises have discovered the situation changes when you introduce state into the equation. Managing state inside Docker containers is difficult, primarily because containers are designed to be lightweight, nimble resources that will move around the cluster, whereas data has a gravity that makes it harder to move. There are other problems such as 1) how to ensure data integrity and isolation when you are running multiple containers on the same host, 2) how to take snapshots of your production data for offsite container backups and CI, and 3) how to encrypt sensitive data both in flight and at rest. Portworx solves these problems and more by creating a cluster-wide data layer from your underlying storage devices while also providing off-site backups, encryption of data in flight and at rest, and full automation of data management.
True data management using Docker
Portworx’s deep integration into Docker gives you the benefits of Portworx container data services, directly through your Docker Swarm scheduler. You can create Swarm services that consume Portworx volumes via the official Docker volume plugin. This brings the power and management capability of Portworx to your Docker persistent storage layer, meaning you can handle difficult tasks such as increasing your storage pool without container downtime, and avoid problems like stuck EBS drives.