问题原文
原帖链接 · Izzy · CC BY-SA 3.0
I have a MySQL server with slave replication on another host. Today I stumbled across the high disk usage of the slave host and invastigated what takes up all the space. As it turns out this space is occupied by the slaves relay logs.
I tried to turn the expire_logs_days variable down and restarted the MySQL daemon but the reported disk space stays the same. I could't really find anything exept that FLUSH LOGS should clear old logs. I tried that with no result.
Is there any way I can reduce the disk space that the relay logs take?
已采纳解答
原帖链接 · Jeremy Tinley · CC BY-SA 3.0
The expire_logs_days setting controls binary logging, not relay logging.
Normally, the relay logs are purged when the slave has finished applying the data from them. This can be changed with relay-log-purge, but it's default is 1.
If your slave is simply behind, it will continue to accumulate relay logs by design. You might want to consider setting relay-log-space-limit to prevent out of disk space problems. This setting provides a disk space limit for the IO thread to use for storing relay logs.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
