Running Percona XtraDB Cluster on Windows … in Docker

Percona XtraDB ClusterIn this blog post, we’ll look at how to run Percona XtraDB Cluster on Windows using Docker.

This is a follow-up to my previous post on Percona XtraBackup on Windows. The fact is that with Docker you can now run a variety of software applications on Windows that previously were available only for Linux platforms.

We can run (to evaluate and for testing purposes) several nodes of Percona XtraDB Cluster on a single Windows box.

The steps for this are:

  1. Setup Docker on the Windows box.
  2. Create a Docker network.
    docker network create net1
  3. Bootstrap the cluster.
    docker run -e MYSQL_ROOT_PASSWORD=test -e CLUSTER_NAME=cl1 --name=node1 --net=net1 perconalab/percona-xtradb-cluster
  4. Join the nodes.
    docker run -e MYSQL_ROOT_PASSWORD=test -e CLUSTER_NAME=cl1 -e CLUSTER_JOIN=node1 --net=net1 perconalab/percona-xtradb-cluster

Repeat step 4 as many times as you want.

The result: the cluster is now running on Windows!

Share this post

Comment (1)

  • YangDi

    How can I set the data directory?
    docker run -d -p 3306:3306 -v F:\db1:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=abc123456 -e CLUSTER_NAME=PXC -e XTRABACKUP_PASSWORD=abc123456 –privileged –name=node1 –net=net1 pxc
    Can not run

    January 30, 2018 at 10:02 am

Comments are closed.

Use Percona's Technical Forum to ask any follow-up questions on this blog topic.