免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2009 | 回复: 0
打印 上一主题 下一主题

innodb_log_files_in_group调整方法 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-19 13:55 |只看该作者 |倒序浏览

官方文档:

 innodb_log_files_in_group

Command-Line Format --innodb_log_files_in_group=#
Option-File Format innodb_log_files_in_group
Option Sets Variable Yes, innodb_log_files_in_group
Variable Name innodb_log_files_in_group
Variable Scope Global
Dynamic Variable No
  Permitted Values
Type numeric
Default 2
Range 2-100

The number of log files in the log group. InnoDB writes to the files in a circular fashion. The default (and recommended) value is 2.

 
当我直接修改my.cnf将该参数改为3的时候
重启mysql,报错,innodb引擎无法挂载
110124 14:06:23  InnoDB: Log file ./ib_logfile2 did not exist: new to be created
110124 14:06:23 [ERROR] Plugin 'InnoDB' init function returned error.
110124 14:06:23 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
 
 
 
 
Saver ——pkman110@msn.com 说 (14:29):
*innodb_log_files_in_group 这个参数在初始化系统之后就不能调整了?
Popgo 说 (14:31):
*可以的
*你要先把原来的log备份下
Saver ——pkman110@msn.com 说 (14:31):
*然后删了?
Popgo 说 (14:32):
*不是啊
Saver ——pkman110@msn.com 说 (14:32):
*那咋搞
Popgo 说 (14:32):
*把原来的log文件备份,把innodb_log_files_in_group变成你需要的。让数据重新生成log文件
 
调整方式:
1.停止服务
 1036  service mysqld stop
2.移走当前的日志文件 
 1038  mkdir bak
 1039  cd bak
 1040  cd ..
 1041  mv ib_logfile* ./bak/
3.在my.cnf中修改参数数值
4.启动服务
 1043  service mysqld start
 
系统处理日志
110124 14:44:55 mysqld_safe Starting mysqld daemon with databases from /data/mysql
110124 14:44:55  InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 512 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Progress in MB: 100 200 300 400 500
110124 14:45:00  InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 512 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Progress in MB: 100 200 300 400 500
110124 14:45:05  InnoDB: Log file ./ib_logfile2 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile2 size to 512 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Progress in MB: 100 200 300 400 500
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
110124 14:45:10  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Last MySQL binlog file position 0 793029012, file name ./mysql-bin.000048
110124 14:45:12  InnoDB: Started; log sequence number 136 3284391948
 
 
 
 
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP