MySQL Master-Master复制生成数千个日志文件

今天,我在主 – 主复制设置中检查了服务器的/ var / lib / mysql /目录,注意到里面有大约3600个slave-relay.00xxxx文件(其中“xxxx”是递增整数)。

他们似乎是二进制日志文件,并没有占用太多的空间(只有大约42K),但他们是一个迹象表明有什么错?

他们的范围从八月到今天约25每天。

谢谢你的帮助。

你可以从dev.mysql中读到这个。

Mysqld appends a numeric extension to the binary log basename to generate binary log file names. The number increases each time the server creates a new log file, thus creating an ordered series of files. The server creates a new file in the series each time it starts or flushes the logs. The server also creates a new binary log file automatically after the current log's size reaches max_binlog_size. A binary log file may become larger than max_binlog_size if you are using large transactions because a transaction is written to the file in one piece, never split between files. 

总之,您可以将日志文件的数量与正在执行的事务和查询的数量关联起来。 此外,日志文件的最大大小可能会影响您将拥有多less个文件。

如果你知道你的数据库总是忙于执行查询(做插入/更新/删除),这应该是正常的。