コマンド
pt-variable-advisor [ オプション ] [ DSN ]
【必須項目】
- ・ [ オプション ] : -p パスワード
- ・ [ DSN ] : h=ホスト名
目的
MySQL変数を分析して、問題の可能性がある設定について出力します
設定ファイル
必須オプションを、設定ファイルにまとめておきます
# touch /etc/percona-toolkit/pt-variable-advisor.conf
# vi /etc/percona-toolkit/pt-variable-advisor.conf
・設定ファイルの作成
# touch /etc/percona-toolkit/pt-variable-advisor.conf
・設定ファイルの編集
# vi /etc/percona-toolkit/pt-variable-advisor.conf
# config for pt-variable-advisor
password=MySQL のパスワード
結果
コマンドを実行すると、変更した方がいい変数が”# WARN”で明示されます?
# pt-variable-advisor localhost
[root@localhost mysql]# pt-variable-advisor localhost
# WARN delay_key_write: MyISAM index blocks are never flushed until necessary.
# NOTE log_warnings-2: Log_warnings must be set greater than 1 to log unusual events such as aborted connections.
# WARN slave_net_timeout: This variable is set too high.
# 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.
# WARN expire_logs_days: Binary logs are enabled, but automatic purging is not enabled.
# 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.
# WARN sync_binlog: Binary logging is enabled, but sync_binlog isn't configured so that every transaction is flushed to the binary log for durability.
良い点
サーバ設定において一般的な問題がないかを確認する際に有効です