An open API service indexing awesome lists of open source software.

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

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.