Sign inSign up

aksaramaya/mariadb

By aksaramaya

•Updated almost 10 years ago

Image
0

398

aksaramaya/mariadb repository overview

⁠docker-mariadb

⁠Available environment configuration

VariableDefault valueDescription
PORT3306Specify the MySQL Service Port
MAX_CONNECTIONS100Specified the maximum of parallel connections allowed to use the service
MYSQL_ROOT_PASSWORDIf set, the root password will be set to this password (only if data-dir was non existent on startup)
MYSQL_DATABASEIf set, this database will be created (only if data-dir was non existent on startup)
MYSQL_USERIf set, this user will be created (only if data-dir was no existent on startup)
MYSQL_PASSWORDIf set, this $MYSQL_USER will be created with this password
LOG_BINBase filename for binary logs (will enable binary logs)
LOG_BIN_INDEXLocation of the log-bin index file
MAX_ALLOWED_PACKET16MThe maximum size of one packet
QUERY_CACHE_SIZE16MThe amount of memory allocated for caching query results
INNODB_LOG_FILE_SIZE48MSize in bytes of each log file in the log group
QUERY_CACHE_TYPE1Set the query cache type 0=OFF, 1=ON, 2=DEMAND
SYNC_BINLOG0Controls the number of binary log commit groups to collect before synchronizing the binary log to disk. When sync_binlog=0, the binary log is never synchronized to disk, and when sync_binlog is set to a value greater than 0 this number of binary log commit groups is periodically synchronized to disk. When sync_binlog=1, all transactions are synchronized to the binary log before they are committed
INNODB_BUFFER_POOL_SIZE128MThe size in bytes of the buffer pool, the memory area where InnoDB caches table and index data
INNODB_FLUSH_METHODDefines the method used to flush data to the InnoDB data files and log files, which can affect I/O throughput
INNODB_OLD_BLOCKS_TIME1000Non-zero values protect against the buffer pool being filled up by data that is referenced only for a brief period, such as during a full table scan. Increasing this value offers more protection against full table scans interfering with data cached in the buffer pool.
INNODB_FLUSH_LOG_AT_TRX_COMMIT1Controls the balance between strict ACID compliance for commit operations, and higher performance that is possible when commit-related I/O operations are rearranged and done in batches. You can achieve better performance by changing the default value, but then you can lose up to a second of transactions in a crash.
⁠Galera specific settings
VariableDefault valueDescription
GALERAIf set the galera extension will be enabled
CLUSTER_NAMEUnique Name that identified the Galera Cluster
NODE_NAMEUnique Node name that identified this node instance
CLUSTER_ADDRESSgcomm:// style resource identifier that provides topology information about the Galera Cluster
REPLICATION_PASSWORDPassword for the replication user which will be needed to allow state transfers using xtrabackupv2 method

⁠Running MariaDB in Standalone Mode

docker run -i -t --rm \
-e TIMEZONE=Europe/Berlin \
-e MYSQL_ROOT_PASSWORD=securepassword \
aksaramaya/mariadb:10.1

⁠Running MariaDB in Galera Cluster Mode

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 \
aksaramaya/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 \
aksaramaya/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/⁠

Tag summary

Content type

Image

Digest

Size

361.8 MB

Last updated

almost 10 years ago

docker pull aksaramaya/mariadb:10.1-centos