大网数据广告活动
服务器运维问答

Need to keep each binlog files to 24 hrs

· 52CE 我爱测

We have a requirement werein we need to keep each binlog files(like mysql-bin-changelog.025249, mysql-bin-changelog.025250, mysql-bin-changelog.025251....) of MYSQL RDS to minimum 24 hrs. However, i see that binlog files are gett…

问题原文

原帖链接 · Sumant Kumar · CC BY-SA 4.0

We have a requirement werein we need to keep each binlog files(like mysql-bin-changelog.025249, mysql-bin-changelog.025250, mysql-bin-changelog.025251....) of MYSQL RDS to minimum 24 hrs.

However, i see that binlog files are getting purged/deleted after 10-12 mins.

Below is the current setup in my RDS parameter group-: 1.binlog retention hours is set to 24 hrs. 2.max_binlog_size is set to 134217728 3.binlog_expire_logs_seconds is set to 2592000.

Also, my MYSQL RDS database is heavily used and has 400+ tables.

Please let me know which parameter i need to change, so that each bin log should be retained for 24 hrs.

已采纳解答

原帖链接 · Tim · CC BY-SA 4.0

According to the AWS RDS documentation, you call a stored procedure to set the binary log retention

call mysql.rds_set_configuration('binlog retention hours', 24);

Here's some relevent information from the docs

The binlog retention hours parameter is used to specify the number of hours to retain binary log files. Amazon RDS normally purges a binary log as soon as possible, but the binary log might still be required for replication with a MySQL database external to Amazon RDS. The default value of binlog retention hours is NULL.

The binlog retention hours parameter is used to specify the number of hours to retain binary log files. Amazon RDS normally purges a binary log as soon as possible, but the binary log might still be required for replication with a MySQL database external to Amazon RDS. The default value of binlog retention hours is NULL.

...

For MySQL DB instances, the maximum binlog retention hours value is 168 (7 days).

After you set the retention period, monitor storage usage for the DB instance to make sure that the retained binary logs don't take up too much storage.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2022-12-30)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。