简体   繁体   中英

Auto-purge of mariadb binary logs

I'm using two mariadb-server (v 10.0.17) in a master-slave environment. 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. 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.

Thanks for responding.

expire_logs_days = 7 -- purge binlogs after a week.

max_binlog_size can be lowered if you need it to be finer grained.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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