生产环境linux suse11.4, 根目录/ 下大小:50g, ibtmp1大小:31g, 磁盘空间爆满100%告警。
ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12m:autoextend,也就是说在支持大文件的系统这个文件大小是可以无限增长的。
1、修改my.cnf配置文件:
innodb_temp_data_file_path = ibtmp1:12m:autoextend:max:5g
2、设置innodb_fast_shutdown参数
set global innodb_fast_shutdown = 0; #innodb does a slow shutdown, a full purge and a change buffer merge before shutting down
3、关闭mysql服务
4、删除ibtmp1文件(重启自动删除)
5、启动mysql服务
注意:为了避免以后再出现类似的情况,一定要在限制临时表空间的最大值,如innodb_temp_data_file_path = ibtmp1:12m:autoextend:max:5g
如对本文有疑问, 点击进行留言回复!!
一步步教你用Prometheus搭建实时监控系统系列(一)——上帝之火,普罗米修斯的崛起
网友评论