P
P
Pavel2020-08-17 09:33:07
MySQL
Pavel, 2020-08-17 09:33:07

Why does a folder with binlogs grow on the MySQL Slave server?

Hello! The essence of the problem:
MySQL is spinning in a docker container. This is a slave that replicates data from the master server. Below is my config on the slave. It seems that I set all the restrictions and the logs should be rotated, and the folder with the logs should not exceed 5Gb, but the folder size increases every week and has already exceeded the limit by 4 times (20Gb). What could be the reason and how to make sure that the folder with the logs does not get out of the limits and does not clog the disk?

[mysqld]
# ID Слейва, удобно выбирать следующим числом после Мастера
server-id = 2

# Путь к relay логу
relay-log = /var/log/mysql/mysql-relay-bin.log

# Путь к bin логу на Мастере
log_bin = /var/log/mysql/mysql-bin.log

# не стартовать сервер автоматически после сбоя 
# - оставляет возможность восстановить сервер при наличии проблем
# skip_slave_start

log_slave_updates = 1 
# Разрешать на подчиненном сервере только чтение
read_only = 1

innodb_file_per_table = ON
innodb_buffer_pool_size = 3G

max_binlog_size = 500M

max_relay_log_size = 500M
relay_log_space_limit = 5G
relay_log_recovery = ON

expire_logs_days = 4

slave-parallel-workers = 0

innodb_temp_data_file_path=ibtmp1:12M:autoextend:max:5G

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Karasik, 2020-08-17
@vitaly_il1

If you are not going to use this slave as a master, then it does not need log_bin at all.
As far as I understand, it is necessary
- log_slave_updates = 0
- to comment out "log_bin"
And show, please, what you have in /var/log/mysql/ - which logs take up space?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question