MySQL Replication Using Docker Containers

<p>Replication enables data from one MySQL database server (known as a source) to be copied to one or more MySQL database servers (known as replicas) (<a href="https://dev.mysql.com/doc/mysql-replication-excerpt/8.0/en/replication.html" rel="noopener ugc nofollow" target="_blank">MySQL</a>).</p> <p>The following steps are modified from the original guide at&nbsp;<a href="https://github.com/alexanderfefelov/docker-mysql-replication" rel="noopener ugc nofollow" target="_blank">GitHub</a>&nbsp;so that they could be run in PowerShell (Windows environment). The idea is to run a Master server followed by N Slave servers; all running as Docker containers.</p> <p>All containers are created from the image repo published at&nbsp;<a href="https://quay.io/repository/alexanderfefelov/mysql-replication" rel="noopener ugc nofollow" target="_blank">https://quay.io/repository/alexanderfefelov/mysql-replication</a>. The entrypoint script builds the container based on the mode parameter (<code>master</code>&nbsp;or&nbsp;<code>slave</code>).</p> <p><img alt="" src="https://miro.medium.com/v2/resize:fit:282/1*duMUjX0zADENTiG8SxwA-w.png" style="height:290px; width:282px" /></p> <p>source:&nbsp;<a href="https://github.com/alexanderfefelov/docker-mysql-replication" rel="noopener ugc nofollow" target="_blank">https://github.com/alexanderfefelov/docker-mysql-replication</a></p> <h1>[0] Pre-requisite</h1> <p>Docker Desktop (This post is using Docker Desktop version 4.24.2)</p> <p><a href="https://blog.devgenius.io/mysql-replication-using-docker-containers-2daa2f4d8ca3"><strong>Learn More</strong></a></p>