Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/garutilorenzo/mariadb-galera
MariaDB Galera cluster dockerized environment
https://github.com/garutilorenzo/mariadb-galera
docker galera-cluster galera-mariadb mariadb mariadb-galera-cluster wsrep
Last synced: 22 days ago
JSON representation
MariaDB Galera cluster dockerized environment
- Host: GitHub
- URL: https://github.com/garutilorenzo/mariadb-galera
- Owner: garutilorenzo
- License: gpl-3.0
- Created: 2021-03-03T15:07:41.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-24T11:21:23.000Z (almost 4 years ago)
- Last Synced: 2024-10-27T08:53:36.758Z (2 months ago)
- Topics: docker, galera-cluster, galera-mariadb, mariadb, mariadb-galera-cluster, wsrep
- Language: Shell
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mariadb-galera
MariaDB Galera cluster dockerized environment* [MariaDB Galera](https://mariadb.com/kb/en/what-is-mariadb-galera-cluster) - MariaDB Galera Cluster is a virtually synchronous multi-master cluster for MariaDB
## Notes about environment
* the configuration of the cluster is not persistent. docker-entrypoint.sh creates the cluster each time the container starts
* the configuration of the running cluster can be fount inside the containers in /etc/mysql/mariadb.conf.d/10-galera.cnf (docker-compose exec mariadb_node01 cat "/etc/mysql/mariadb.conf.d/10-galera.cnf")
* MariaDB volumes persist until command docker-compose down -v is gived
* at first startup of the cluster or when all nodes are down set BOOTSTRAP=1 on one of the nodes (--wsrep-new-cluster)## Environment variables
* BOOTSTRAP: tells mariadb to start with --wsrep-new-cluster parameter
* CLUSTER_NAME: the name of the cluster
* CLUSTER_MEMBERS: comma separated list of cluster members (ip or fqdn)# Usage
Start che cluster:
```console
docker-compose up -d
```Stop one node:
```console
docker-compose stop mariadb_node01
```Stop all nodes:
```console
docker-compose stop
```To start the cluster again (whit all nodes down) run:
```console
bash restart_cluster.sh
```This will delete all containers but the volumes with MariaDB data still exist.
Now set BOOTSTRAP=1 on one of the nodes and then start the cluster:```console
docker-compose up -d
```Tear down and clean all:
```console
docker-compose down -v
```[![MariaDB Galera Cluster CI](https://github.com/garutilorenzo/mariadb-galera/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/garutilorenzo/mariadb-galera/actions/workflows/ci.yml)