Skip to content
mysql replication demo using docker, tmux and tmuxinator
Shell
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
replication
.gitignore
Dockerfile-tmuxinator
README.md
high-performance-mysql.png

README.md

High Performance MySQL Sandbox

high performance mysql

Recently I finished reading High Performance MySQL by Baron Schwartz, Peter Zaitsev and Vadim Tkachenko. The book covers replication, partitioning, benchmarking, query analysis, etc. This repo is a collection of little "sandbox" environments I created to just kick-the-tires and try stuff out.

The first thing I'm going to try is setting up MySQL replication using docker and docker-compose. I'll use a container with tmux and tmuxinator to make a visualization.

asciicast

Files

  • Dockerfile-tmuxinator A dockerfile that builds an image with tmux, tmuxinator, vim and the docker client binaries. The container created from this image will have the docker socket mounted within it so the client docker library in the container can communicate with the host's dockerd.

Replication Demo Usage

$ ./replication/start.sh

Notes...

# build visualization container image
$ docker build -f ./Dockerfile-tmuxinator -t tmuxinator .

# start the containers
$ cd replication
$ docker-compose build
$ docker-compose up

# start visualization container
# IN ./replication/
$ docker run \
    --rm \
    -it \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v ./:/root \
    --network replicatoin_default \
    --name tmuxinator \
    tmuxinator:latest \
    tmuxinator start -p /root/tmuxinator-replication.yml

NOTE:

  • get tmux layout docker exec tmuxinator tmux list-windows | sed -n 's/.*layout \(.*\)] @.*/\1/p'
You can’t perform that action at this time.