简体   繁体   English

自动清除mariadb二进制日志

[英]Auto-purge of mariadb binary logs

I'm using two mariadb-server (v 10.0.17) in a master-slave environment. 我在主从环境中使用两个mariadb-server(v 10.0.17)。 From time to time I have to purge the "old" binary logs on the master which have already been fetched by the slave. 我不时要清除主设备上已经被从设备提取的“旧”二进制日志。

I wounder if there is a hidden setting in mariadb to auto-purge these binary logs. 如果在mariadb中有一个隐藏设置来自动清除这些二进制日志,我会更加干净。 I think the master knows the amount of slaves and the log an position every slave has reached. 我认为主人知道奴隶的数量和日志每个奴隶达到的位置。

On the on hand its quite useful because you can easily set up another slave if you want and use the existin binary logs for getting to the same position as the master but on the other hand it fills up my diskspace which is sometimes very low. 一方面它非常有用,因为你可以轻松地设置另一个奴隶,如果你想要并使用existsin二进制日志来获得与主服务器相同的位置,但另一方面它填满了我的磁盘空间,有时非常低。

Thanks for responding. 谢谢你的回复。

expire_logs_days = 7 -- purge binlogs after a week. expire_logs_days = 7 - 一周后清除binlogs。

max_binlog_size can be lowered if you need it to be finer grained. 如果您需要更精细的粒度,可以降低max_binlog_size

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM