Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

hauptmedia/docker-mariadb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 

Repository files navigation

docker-mariadb

Available environment configuration

PORT- Specify the MySQL Service Port

MAX_CONNECTIONS - Specified the maximum of parallel connections allowed to use the service

MYSQL_ROOT_PASSWORD - If set, the root password will be set to this password (only if data-dir was non existent on startup)

MYSQL_DATABASE - If set, this database will be created (only if data-dir was non existent on startup)

MYSQL_USER - If set, this user will be created (only if data-dir was no existent on startup)

MYSQL_PASSWORD - If set, this $MYSQL_USER will be created with this password

LOG_BIN - Base filename for binary logs (will enable binary logs)

LOG_BIN_INDEX - Location of the log-bin index file

Galera specific settings

GALERA - If set the galera extension will be enabled

CLUSTER_NAME - Unique Name that identified the Galera Cluster

NODE_NAME - Unique Node name that identified this node instance

CLUSTER_ADDRESS - gcomm:// style resource identifier that provides topology information about the Galera Cluster

REPLICATION_PASSWORD - Password for the replication user which will be needed to allow state transfers using xtrabackupv2 method

MariaDB Galera Cluster

For known limitations have a look at https://mariadb.com/kb/en/mariadb/mariadb-galera-cluster-known-limitations

Initializing a new cluster

docker run -i -t --rm \
-e TIMEZONE=Europe/Berlin \
-e MYSQL_ROOT_PASSWORD=test \
-e REPLICATION_PASSWORD=test \
-e GALERA=On \
-e NODE_NAME=node1 \
-e CLUSTER_NAME=test \
-e CLUSTER_ADDRESS=gcomm://ipOrHost1,ipOrHost2,ipOrHost3 \
hauptmedia/mariadb:10.1 --wsrep-new-cluster

Joining a node to the cluster

docker run -i -t --rm \
-e TIMEZONE=Europe/Berlin \
-e MYSQL_ROOT_PASSWORD=test \
-e REPLICATION_PASSWORD=test \
-e GALERA=On \
-e NODE_NAME=node2 \
-e CLUSTER_NAME=test \
-e CLUSTER_ADDRESS=gcomm://ipOrHost1,ipOrHost2,ipOrHost3 \
hauptmedia/mariadb:10.1

Please note: if you don't specify the timezone the server will run with UTC time

Recover strategies

To fix a split brain in a failed cluster make sure that only one node remains in the cluster and run

SET GLOBAL wsrep_provider_options='pc.bootstrap=true';

For more information about recovering a galera cluster have a look at https://www.percona.com/blog/2014/09/01/galera-replication-how-to-recover-a-pxc-cluster/

About

MariaDB Docker Images

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published