https://github.com/arojunior/docker-springboot-proxysql
MySQL Replication and ProxySQL with Spring boot application to test connections
https://github.com/arojunior/docker-springboot-proxysql
docker java mysql proxysql spring-boot
Last synced: 3 months ago
JSON representation
MySQL Replication and ProxySQL with Spring boot application to test connections
- Host: GitHub
- URL: https://github.com/arojunior/docker-springboot-proxysql
- Owner: arojunior
- Created: 2018-06-25T16:20:30.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-10-23T16:06:25.000Z (almost 6 years ago)
- Last Synced: 2025-05-19T17:38:10.314Z (about 1 year ago)
- Topics: docker, java, mysql, proxysql, spring-boot
- Language: Java
- Size: 57.6 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker MySQL Replication and ProxySQL experiments
Simple application with MySQL Replication master/master. Server made with Spring Boot and connected to ProxySQL, without knowing the databases.
You can test it starting the application and stopping one of the MySQL Server's, the behavior of the proxy is to keep the connection up.
### Setup with Docker
To start the proxy and database's:
```sh
docker-compose up -d
```
### Steps to configure MySQL replication
Go to **mysql_server_1**
```sh
show master status;
```
Take result and fill:
```sh
stop slave;
CHANGE MASTER TO master_host='mysql_master_2', master_port=3308, master_user='root', master_password='root',master_log_file='mysql-bin.000001', master_log_pos=154;
start slave;
```
* Change `master_log_file` and `master_log_pos` with previous result.
Then go to **master_server_2** and repeat steps:
```sh
show master status;
```
Take result and fill:
```sh
stop slave;
CHANGE MASTER TO master_host='mysql_master_1', master_port=3307, master_user='root', master_password='root',master_log_file='mysql-bin.000001', master_log_pos=154;
start slave;
```
* Change `master_log_file` and `master_log_pos` with previous result.
### Start tests
```sh
cd server
./mvnw test
```
With tests running, you can test the proxy stopping and starting the instances of MySQL
```sh
docker-compose stop mysql_master_1
```