开发者

Is it safe to delete replication relay-bin files?

开发者 https://www.devze.com 2023-02-06 11:58 出处:网络
I\'ve got a small database, around 50mb. It\'s a master replicating to a remote server开发者_JS百科. I noticed that the relay-bin files total to over 5GB. Is it safe to delete them?I think a better an

I've got a small database, around 50mb. It's a master replicating to a remote server开发者_JS百科. I noticed that the relay-bin files total to over 5GB. Is it safe to delete them?


I think a better answer is relay logs can be 'deleted' but mysql should manage it automatically. One way to do this is to check for the value of relay_log_purge.

It should be set to 1 if you want mysql to manage them:

set global relay_log_purge=1;

You would probably need to flush the logs:

flush logs;

This does not affect the binary logs.


Maybe try to resync your master and slave.

If possible, cleanup the slave by running a

reset slave

it will purge all relay binary logs.

Then set the replication again with change master to ... You may have too much lag between your master and slave.


From the MySQL manual:

The SQL thread automatically deletes each relay log file after it has executed all events in the file and no longer needs it. There is no explicit mechanism for deleting relay logs because the SQL thread takes care of doing so. However, FLUSH LOGS rotates relay logs, which influences when the SQL thread deletes them.


No, do not delete the relay-bin files manually. What you can do is to purge the binary files using MySQL commands. See the MySQL 5.0 Manual for more on the PURGE BINARY LOGS command.

0

精彩评论

暂无评论...
验证码 换一张
取 消