Difficulty: Beginner
Estimated Time: 10 minutes

In this tutorial, you will learn how to use Postgres with StorageOS and configure volumes for high availability.

Postgres

Step 1 of 3

Installation

PostgreSQL or “Postgres” is an open source object-relational database management system (ORDBMS). It's deployed across a wide variety of platforms with a mix of workloads ranging from small, single-node use cases to large Internet-facing with many concurrent users.

In this tutorial, we'll look at how to configure it with StorageOS for high availability and failover.

Start a Postgres container specifying StorageOS as the volume driver:

docker run -d --name postgres-dev \ --volume-driver=storageos \ --volume pgdata:/var/lib/postgresql/data \ --env PGDATA=/var/lib/postgresql/data/pgdata \ --env POSTGRES_PASSWORD=storageos postgres

Note that StorageOS has dynamically provisioned the new volume pgdata:

storageos volume ls --format "table {{.Name}}\t{{.Size}}\t{{.Status}}\t{{.MountedBy}}\t{{.Location}}"