Percona-toolkit usage tutorial-configuration tools 1. pt-config-diff
L function introduction:
Compare mysql configuration files and server parameters
L usage:
Pt-config-diff [OPTION...] CONFIG [CONFIG...]
CONFIG can be a file or a data source name. at least two configuration file sources must be specified, just like the diff command under unix. if the configuration is exactly the same, nothing will be output.
L example:
Example 1: view the differences between the local and remote server configuration files:
Pt-config-diff h = localhost h = 192.168.3.92 -- user = root -- password = zhang @ 123
The comparison content is as follows:
22 config differences
Variable localhost. localdomain localhost. localdomain
========================================================== ======================================
Binlog_cache_size 8388608 2097152
Have_ndbcluster DISABLED NO
Innodb_additional_mem _... 16777216 33554432
Innodb_buffer_pool_size 1677721600 1073741824
Example 2: compare the differences between local configuration files and remote servers:
Pt-config-diff/etc/my. cnf h = 192.168.3.92 -- user = root -- password = zhang @ 123
The comparison content is as follows:
12 config differences
Variable/etc/my. cnf localhost. localdomain
========================================================== ========================
Binlog_cache_size 8388608 2097152
Binlog_format mixed MIXED
Example 3: compare the differences between two local configuration files:
Pt-config-diff/usr/local/mysql/share/mysql/my-large.cnf/usr/local/mysql/share/mysql/my-medium.cnf
2. pt-mysql-summary
L function introduction:
The configuration of mysql and the sataus information are summarized in detail. After the summary, you can see it at a glance.
L usage:
Pt-mysql-summary [OPTIONS] [-- mysql options]
Working Principle: Connect to mysql and query the status and configuration information and save it to the temporary directory. Then, use awk and other script tools for formatting. OPTIONS can be found on the official website.
L example:
Example 1: summarize the status and configuration information of the local mysql server:
Pt-mysql-summary -- user = root -- password = zhang @ 123 -- host = localhost
Example 2: summarize the status and configuration information of the local mysql server 192.168.3.92:
Pt-mysql-summary -- user = root -- password = zhang @ 123 -- host = 192.168.3.92
3. pt-variable-advisor
L function introduction:
Analyze mysql parameter variables and provide suggestions for possible problems
L usage:
Pt-variable-advisor [OPTION...] [DSN]
Principle: check the configuration error settings and values in show variables according to predefined rules.
L example:
Example 1: Get the variable value from localhost
Pt-variable-advisor -- user = root -- password = zhang @ 123 localhost
Example 2: Read the configuration from the specified file. the format is required.
Pt-variable-advisor -- user = root -- password = zhang @ 123 -- source-of-variables my. cnf