https://github.com/erasys/mariadb-ha-test
A docker-compose environment to test a MariaDB HA cluster with master-slave replication
https://github.com/erasys/mariadb-ha-test
mariadb maxscale replication-manager test
Last synced: about 1 month ago
JSON representation
A docker-compose environment to test a MariaDB HA cluster with master-slave replication
- Host: GitHub
- URL: https://github.com/erasys/mariadb-ha-test
- Owner: erasys
- Created: 2018-03-14T16:12:21.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-16T16:49:38.000Z (over 8 years ago)
- Last Synced: 2025-03-04T23:44:01.662Z (over 1 year ago)
- Topics: mariadb, maxscale, replication-manager, test
- Language: Shell
- Size: 8.79 KB
- Stars: 4
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MariaDB HA Test Setup
This project provides a docker-compose setup to spawn two independent MariaDB clusters, each
with 4 nodes in a single master & multiple slaves setup, and one additional warehouse
database which replicates from both clusters using multisource replication.
It uses [MariaDB MaxScale](https://mariadb.com/products/technology/maxscale) as access proxy
and the [Signal18 Replication Manager](https://signal18.io/products/srm) to handle failover.
A instance of PHPMyAdmin is included for convenience.
## Usage
To launch, just run
```sh
docker-compose up -d
```
This will spawn all MariaDB instances, MaxScale and Replication Manager, and calls a setup
script (located at `setup/setup.sh`) which creates permissions, sets up initial replication
in the clusters and the warehouse and creates some database tables to use.
To stop, do
```sh
docker-compose down -v
```
## Default configuration & exposed ports
The MaxScale container is configured to use the `readwritesplit` router. It exposes cluster
A on host level at port `3306` and cluster B on port `3307`. If you want to connect with the
mysql cli from your host, be sure to use `127.0.0.1` as hostname instead of `localhost`,
otherwise the cli tries to connect via a socket.
MaxScale's MaxAdmin API is exposed on `localhost:6603`, but it's also possible to call
maxadmin in the container with
```sh
docker-compose exec maxscale maxadmin
```
The web interface of Replication Manager can be accessed at http://localhost:10001
There's a command `stress/create-load.sh` to be executed on the host to write data to the two
clusters.