MariaDB Docker container which provides the MariaDB database server with Galera clustering support.
6.4K
Container Source - GitHub Mirror
This is the Conarx Containers MariaDB image, it provides the MariaDB database bundled with clustering support provided by Galera.
Additional features:
| Provider | Repository |
|---|---|
| DockerHub | allworldit/mariadb |
| Conarx | registry.conarx.tech/containers/mariadb |
All our Docker images are part of our Conarx Containers product line. Images are generally based on Alpine Linux and track the
Alpine Linux major and minor version in the format of vXX.YY.
Images built from source track both the Alpine Linux major and minor versions in addition to the main software component being
built in the format of vXX.YY-AA.BB, where AA.BB is the main software component version.
Our images are built using our Flexible Docker Containers framework which includes the below features...
Please use the project Issue Tracker.
Commercial support for all our Docker images is available from Conarx.
We also provide consulting services to create and maintain Docker images to meet your exact needs.
Additional environment variables are available from...
Environment variables were prefixed with MYSQL_ to try retain as much compatibility to the official MariaDB and MySQL images as
possible.
Optional root password for the MySQL database when its created. If not assigned, it will be automatically generated and output in the logs.
Optional database to create.
Optional user to create for the MySQL database. It will be granted access to the MYSQL_DATABASE database.
Optional password to set for MYSQL_USER.
Optional character set for the database. Deafults to utf8mb4.
Optional collation for the database. Deafults to uca1400_as_ci.
Should be set to 60% of the available memory.
eg. MYSQL_BUFFER_SIZE=200M
Setup query caching with a query cache size in MBytes. eg. MYSQL_QUERY_CACHE_SIZE=8
MariaDB data directory.
Any file in this directory with a .sql, .sql.gz, .sql.xz or .sql.zst extension will be loaded into the database apon initialization.
MariaDB port 3306 is exposed.
When using clustering the database credentials above and below MUST be the same across all nodes.
If you are moving the first node from a normal DB to a clustered setup you will need to create a .create_sst_user file in the
data directory for the sync user to be created.
touch data/var/lib/mysql/.create_sst_user
Environment variables can be set to configure the cluster.
This option will enable clustering
Comma separated list of cluster nodes to join. The bare minimum configuration for this option is the value of MYSQL_CLUSTER_NODE_NAME
below.
Mandatory Option
This must be specified, the default password used is msyql.sst which is not secure.
Enable database cluster debugging mode. eg. MYSQL_CLUSTER_DEBUG=yes
Optional name of the cluster.
Optional hostname of the node. Defaults to hostname -f.
Optional IP address of the node. Defaults to the IP which hostname -i outputs.
Optional TCP/IP port of this node for cluster communication. Defaults to 3306.
Enable GTID support in the cluster.
Mandatory option for GTID
This must be set to a globally unique node ID. It must not be the same as any MYSQL_CLUSTER_GTID_CLUSTER_ID.
Mandatory option for GTID
This must be set to a globally unique node ID. It must not be the same as any MYSQL_CLUSTER_GTID_LOCAL_ID.
Should this be the first node starting up, create the data directory and touch the bootstrap file using the below...
mkdir -p data/var/lib/mysql
touch data/var/lib/mysql/.bootstrap-cluster
This will add --wsrep-new-cluster commandline option to the server and set this node as primary.
When a node is not the last one to leave a cluster, but needs to be the first one to startup, we need to further force this behavior or the cluster will not start. For this one can use the below. This must be done in ADDITION to the above.
touch data/var/lib/mysql/.force-bootstrap-cluster
MYSQL_USER=testuser
MYSQL_PASSWORD=testpass
MYSQL_ROOT_PASSWORD=rootpass
MYSQL_DATABASE=testdb
# Cluster configuration
MYSQL_CLUSTER_NODE_NAME=node1
MYSQL_CLUSTER_JOIN=node1,node2,node3
# Optional GTID support
MYSQL_CLUSTER_USE_GTID=yes
MYSQL_CLUSTER_GTID_LOCAL_ID=10
MYSQL_CLUSTER_GTID_CLUSTER_ID=100
Initialize the data volume and set this node to force bootstrapping...
mkdir -p data/var/lib/mysql
touch data/var/lib/mysql/bootstrap-cluster
MYSQL_USER=testuser
MYSQL_PASSWORD=testpass
MYSQL_ROOT_PASSWORD=rootpass
MYSQL_DATABASE=testdb
# Cluster configuration
MYSQL_CLUSTER_NODE_NAME=node2
MYSQL_CLUSTER_JOIN=node1,node2,node3
# Optional GTID support
MYSQL_CLUSTER_USE_GTID=yes
MYSQL_CLUSTER_GTID_LOCAL_ID=20
MYSQL_CLUSTER_GTID_CLUSTER_ID=200
Initialize the data volume...
mkdir -p data/var/lib/mysql
MYSQL_USER=testuser
MYSQL_PASSWORD=testpass
MYSQL_ROOT_PASSWORD=rootpass
MYSQL_DATABASE=testdb
# Cluster configuration
MYSQL_CLUSTER_NODE_NAME=node3
MYSQL_CLUSTER_JOIN=node1,node2,node3
# Optional GTID support
MYSQL_CLUSTER_USE_GTID=yes
MYSQL_CLUSTER_GTID_LOCAL_ID=30
MYSQL_CLUSTER_GTID_CLUSTER_ID=300
Initialize the data volume...
mkdir -p data/var/lib/mysql
Content type
Image
Digest
sha256:613c0dbf6…
Size
126.1 MB
Last updated
2 days ago
docker pull allworldit/mariadb