Skip to content

Commit

Permalink
Fine-tuning
Browse files Browse the repository at this point in the history
- Use healthcheck.sh for docker compose test
- write slow query log to datadir to avoid another volume mount
- use slow query full verbosity
- skip-slave-start option not needed for primary
  • Loading branch information
RazvanLiviuVarzaru committed Nov 29, 2024
1 parent 6b68cd2 commit f2232f2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
3 changes: 1 addition & 2 deletions docker-compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +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-config/dev/mariadb.cnf:/etc/mysql/conf.d/mariadb.cnf:ro
- ./logs/mariadb:/var/log/mysql
logging:
driver: journald
options:
Expand Down
3 changes: 1 addition & 2 deletions docker-compose/generate-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +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-config/{config_path}/mariadb.cnf:/etc/mysql/conf.d/mariadb.cnf:ro
- ./logs/mariadb:/var/log/mysql
logging:
driver: journald
options:
Expand Down
9 changes: 3 additions & 6 deletions docker-compose/mariadb-config/prod/mariadb.cnf
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ innodb_log_file_size = 2G
# some log option may be ignored.
# see: https://mariadb.com/kb/en/mysqld-options/#-log-basename
# log_error = /var/log/mysql/error.log
slow_query_log
slow_query_log_file = /var/log/mysql/mariadb-slow.log
log_slow_query
log_slow_query_file = mariadb-slow.log
long_query_time = 2
log_slow_verbosity = query_plan,explain
log_error = /var/log/mysql/mariadb.err.log
log_slow_verbosity = full

# Query cache
query_cache_size = 16M
Expand All @@ -49,8 +48,6 @@ 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
skip-slave-start


[mysqldump]
quick
Expand Down

0 comments on commit f2232f2

Please sign in to comment.