From d1d0d89ba75986237f7b5b7812406b1f08a35c40 Mon Sep 17 00:00:00 2001 From: Adam Monsen Date: Fri, 17 Feb 2023 06:13:12 -0800 Subject: [PATCH] Enable MariaDB binary log (#1881) * Enable MariaDB binary log This resolves a warning in the database server log: [Warning] You need to use --log-bin to make --binlog-format work. Pros: * support for point-in-time recovery * necessary for replication Cons: * slows down database operations ("slightly", per the manual) * takes up disk space (mitigated by `--expire-logs-days=2`) See also: * * Alternatives: 1. Do not add `--log-bin`. Remove `--binlog-format` instead. This causes the least amount of change for existing installations. Signed-off-by: Adam Monsen * remove --expire-logs-days=2 mariadb flag This better aligns with recommendations in the Nextcloud documentation. Also: the flag isn't necessary. There are already set times for cleanup: The MySQL and MariaDB documentation both state that binary logs will be purged on startup and flush/rotation. Signed-off-by: Adam Monsen --------- Signed-off-by: Adam Monsen --- .../docker-compose/insecure/mariadb/apache/docker-compose.yml | 2 +- .../docker-compose/insecure/mariadb/fpm/docker-compose.yml | 2 +- .../with-nginx-proxy/mariadb/apache/docker-compose.yml | 2 +- .../with-nginx-proxy/mariadb/fpm/docker-compose.yml | 2 +- README.md | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.examples/docker-compose/insecure/mariadb/apache/docker-compose.yml b/.examples/docker-compose/insecure/mariadb/apache/docker-compose.yml index d5e30393..facf6fd2 100644 --- a/.examples/docker-compose/insecure/mariadb/apache/docker-compose.yml +++ b/.examples/docker-compose/insecure/mariadb/apache/docker-compose.yml @@ -3,7 +3,7 @@ version: '3' services: db: image: mariadb:10.5 - command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW + command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW restart: always volumes: - db:/var/lib/mysql diff --git a/.examples/docker-compose/insecure/mariadb/fpm/docker-compose.yml b/.examples/docker-compose/insecure/mariadb/fpm/docker-compose.yml index c3c94f39..1b9b3039 100644 --- a/.examples/docker-compose/insecure/mariadb/fpm/docker-compose.yml +++ b/.examples/docker-compose/insecure/mariadb/fpm/docker-compose.yml @@ -3,7 +3,7 @@ version: '3' services: db: image: mariadb:10.5 - command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW + command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW restart: always volumes: - db:/var/lib/mysql diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb/apache/docker-compose.yml b/.examples/docker-compose/with-nginx-proxy/mariadb/apache/docker-compose.yml index eaf18678..d88c9db4 100644 --- a/.examples/docker-compose/with-nginx-proxy/mariadb/apache/docker-compose.yml +++ b/.examples/docker-compose/with-nginx-proxy/mariadb/apache/docker-compose.yml @@ -3,7 +3,7 @@ version: '3' services: db: image: mariadb:10.5 - command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW + command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW restart: always volumes: - db:/var/lib/mysql diff --git a/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/docker-compose.yml b/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/docker-compose.yml index 80088993..c4e6fec3 100644 --- a/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/docker-compose.yml +++ b/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/docker-compose.yml @@ -3,7 +3,7 @@ version: '3' services: db: image: mariadb:10.5 - command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW + command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW restart: always volumes: - db:/var/lib/mysql diff --git a/README.md b/README.md index 0da37051..969df074 100644 --- a/README.md +++ b/README.md @@ -241,7 +241,7 @@ services: db: image: mariadb:10.5 restart: always - command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW + command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW volumes: - db:/var/lib/mysql environment: @@ -287,7 +287,7 @@ services: db: image: mariadb:10.5 restart: always - command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW + command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW volumes: - db:/var/lib/mysql environment: