Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDBF-829 - Update MariaDB Server cnf #655

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docker-compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
---
services:
mariadb:
image: mariadb:10.11
image: mariadb:10.11.10
restart: unless-stopped
container_name: mariadb
hostname: mariadb
Expand All @@ -15,10 +15,10 @@ services:
- MARIADB_AUTO_UPGRADE=1
network_mode: host
healthcheck:
test: ['CMD', "mariadb-admin", "--password=password", "--protocol", "tcp", "ping"]
test: ['CMD', "healthcheck.sh", "--connect", "--innodb_initialized"]
volumes:
- ./mariadb:/var/lib/mysql:rw
- ./mariadb.cnf:/etc/mysql/conf.d/mariadb.cnf:ro
- /srv/mariadb:/var/lib/mysql:rw
- ./mariadb-config/dev/mariadb.cnf:/etc/mysql/conf.d/mariadb.cnf:ro
RazvanLiviuVarzaru marked this conversation as resolved.
Show resolved Hide resolved
logging:
driver: journald
options:
Expand Down
9 changes: 5 additions & 4 deletions docker-compose/generate-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
---
services:
mariadb:
image: mariadb:10.11
image: mariadb:10.11.10
RazvanLiviuVarzaru marked this conversation as resolved.
Show resolved Hide resolved
restart: unless-stopped
container_name: mariadb
hostname: mariadb
Expand All @@ -41,10 +41,10 @@
- MARIADB_AUTO_UPGRADE=1
network_mode: host
healthcheck:
test: ['CMD', "mariadb-admin", "--password=password", "--protocol", "tcp", "ping"]
test: ['CMD', "healthcheck.sh", "--connect", "--innodb_initialized"]
volumes:
- ./mariadb:/var/lib/mysql:rw
- ./mariadb.cnf:/etc/mysql/conf.d/mariadb.cnf:ro
- /srv/mariadb:/var/lib/mysql:rw
- ./mariadb-config/{config_path}/mariadb.cnf:/etc/mysql/conf.d/mariadb.cnf:ro
logging:
driver: journald
options:
Expand Down Expand Up @@ -194,6 +194,7 @@ def main(args):
start_template.format(
port=master_web_port,
environment="" if args.env == "prod" else "dev_",
config_path=args.env,
)
)
port = starting_port
Expand Down
17 changes: 17 additions & 0 deletions docker-compose/mariadb-config/dev/mariadb.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[mariadb]

# InnoDB
innodb_buffer_pool_size = 4G
innodb_log_file_size = 4G
innodb_io_capacity = 2000

# Logging
slow_query_log
log_slow_query_file = mariadb-slow.log
log_slow_verbosity = full
log_slow_query_time = 2

# Character sets
character-set-server = utf8mb4
collation-server = utf8mb4_uca1400_ai_ci
old_mode = ''
44 changes: 44 additions & 0 deletions docker-compose/mariadb-config/prod/mariadb.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[mariadb]

# Fine tuning
max_connections = 300
RazvanLiviuVarzaru marked this conversation as resolved.
Show resolved Hide resolved
wait_timeout = 600
max_allowed_packet = 32M
thread_cache_size = 128
sort_buffer_size = 128M
bulk_insert_buffer_size = 128M
tmp_table_size = 32M
max_heap_table_size = 32M
innodb_log_file_size = 2G
RazvanLiviuVarzaru marked this conversation as resolved.
Show resolved Hide resolved

# Logging
# warning log-basename is defined later for replication
# some log option may be ignored.
# see: https://mariadb.com/kb/en/mysqld-options/#-log-basename
# log_error = /var/log/mysql/error.log
log_slow_query
log_slow_query_file = mariadb-slow.log
log_slow_query_time = 2
log_slow_verbosity = full

# Character sets
character-set-server = utf8mb4
collation-server = utf8mb4_uca1400_ai_ci
old_mode = ''

# InnoDB
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
innodb_buffer_pool_size = 40G
RazvanLiviuVarzaru marked this conversation as resolved.
Show resolved Hide resolved

# Replication
server-id = 1
log-basename = mariadb

log_bin
expire_logs_days = 5
max_binlog_size = 100M
binlog_format = MIXED
# the following permits to simplify the process of moving a replica to a
# primary node role by ensuring that replication is not started on primary node

8 changes: 0 additions & 8 deletions docker-compose/mariadb.cnf

This file was deleted.

1 change: 0 additions & 1 deletion rsync.exclude
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ autogen
ci_build_images
docker-compose/logs
docker-compose/certbot
docker-compose/mariadb
docker-compose/nginx/conf.d/bb.conf
docker-compose/nginx/conf.d/ci.conf
master-libvirt/id_ed25519
Expand Down