Skip to content

This repo contains docker-compose file which will set mariadb delayed replica

Notifications You must be signed in to change notification settings

TayyabTalha/docker-mysql-delayed-replication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MARIADB DELAYED REPLICATION DOCKER

This repo contains docker-compose file which will set mariadb delayed replica

Getting Started:

Follow these steps

Prerequisites

You need install following

copy .env.example to .env

cp .env.example .env

Now edit .env it has following variables

Variable Name Description
MYSQL_MASTER_PASSWORD Password of mariadb root for master node
MYSQL_SLAVE_PASSWORD Password of mariadb root for replica node
MYSQL_REPLICATION_USER Username which will be used to connect to master node by replica node
MYSQL_REPLICATION_PASSWORD Password which will be used to connect to master node by replica node
MASTER_DELAY Dealy for query to run in seconds

Running

Run the containers by running following command

docker-compose up -d

Once every thing is up and running now run following command

docker ps

it will show you all of your container running there you can find docker-mysql-delayed-replication_mysql-master_1

 docker exec -ti docker-mysql-delayed-replication_mysql-master_1 bash

Connect to your database don't forget to replace YOUR_MASTER_ROOT_PASSOWRD

mysql -uroot -p<YOUR_MASTER_ROOT_PASSOWRD>;

Now create a database don't forget to replace DATA_BASE_NAME_HERE

CREATE DATABASE <DATA_BASE_NAME_HERE>;

Now connect to you replica node connect to mysql and check your database by running following command

SHOW DATABASES;

After time you specifed in .env you will see the new database. Now create a table and insert some recode and test resules.

About

This repo contains docker-compose file which will set mariadb delayed replica

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages