Difficulty: intermediate
Estimated Time: 10 - 15 minutes

Portworx is distributed file, block and object storage software purpose built for cloud native applications deployed as containers via a container orchestrator such as Kubernetes.

In this tutorial, you will:

Ha hahah`

  1. Learn how to deploy a basic 3 node Portworx Cluster.
  2. Launch a mysql database and dynamically create a highly available PX volume.
  3. Simulate a failover of a node and demonstrate high availability of the mysql database.
  4. Take a snapshot of the mysql database and launch a second instance of mysql with the snapshot.

You've completed your first Katacoda scenario!

Don’t stop now! The next scenario will only take about 10 minutes to complete.

Deploy Portworx

Step 1 of 3

Step 1 - Install etcd

In this step, you will install Portworx on 3 seperate hosts and configure a 3 node Portworx cluster.

Prepare the hosts

Portworx (PX) requires at least some nodes in the cluster to have dedicated storage for Portworx to use. PX will then carve out virtual volumes from these storage pools. In this example, we use a loopback device to provide a local storage pool to each PX instance. As you can see on the right, a 64GB loopback device has already been provisioned on these hosts.

Task

Type lsblk to list the available devices. Note the loopback storage device, which will be passed into PX as one of it's raw block disks.

In addition, PX relies on an external key value database (KVDB) like etcd or consul to store it's cluster discovery and bootstrap information.

Note:
In a production environment, please deploy a multi node etcd cluster following these instructions: https://coreos.com/etcd

Task

Create an etcd instance via Docker.

IP=$(hostname -I | awk '{print $1}') && \ docker run \ -d \ --net=host \ -p 2379:2379 \ --volume=/var/lib/etcd:/etcd-data \ --name etcd quay.io/coreos/etcd \ /usr/local/bin/etcd \ --data-dir=/etcd-data --name node1 \ --advertise-client-urls http://${IP}:2379 \ --listen-client-urls http://${IP}:2379 \ --initial-advertise-peer-urls http://${IP}:2380 \ --listen-peer-urls http://${IP}:2380 \ --initial-cluster node1=http://${IP}:2380

Verify that etcd is functional: curl -X GET http://${IP}:2379/version

Note the IP address of this host

echo $IP

We will use this IP address when we start PX.