1.变量顾问
[root@mysql1 ~]# pt-variable-advisor --user=root --password=rootroot 192.168.1.51
# WARN delay_key_write: MyISAM index blocks are never flushed until necessary.
# WARN key_buffer_size: The key buffer size is set to its default value,
#which is not good for most production systems.
# NOTE sort_buffer_size-1: The sort_buffer_size variable should generally be left at its default
#unless an expert determines it is necessary to change it.
# NOTE innodb_data_file_path: Auto-extending InnoDB files can consume
#a lot of disk space that is very difficult to reclaim later.
# NOTE innodb_flush_method: Most production database servers that
#use InnoDB should set innodb_flush_method to O_DIRECT to avoid double-buffering,
#unless the I/O system is very low performance.
# WARN myisam_recover_options: myisam_recover_options should be set to some value
#such as BACKUP,FORCE to ensure that table corruption is noticed.
2.中文解释
key_buffer_size是用于索引块的缓冲区的大小。这个设置未默认值是不好的。主要针对Myisam存储引擎。
innodb_flush_method 这个参数建议设置为:O_DIRECT;
myisam_recover_options参数可以设置为: BACKUP,FORCE 值,确保能够通知损坏。
3.总结。
pt-variable-advisor 变量顾问工具,在进行数据库巡检和数据库首次安装后的检查非常有用。