Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and configure Percona-toolkit

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly shows you "how to install and configure Percona-toolkit", the content is easy to understand, clear, hope to help you solve your doubts, let the editor lead you to study and learn "how to install and configure Percona-toolkit" this article.

Pt tool is a very practical and effective tool set, and it is very effective for diagnosing conventional problems. Compared with Oracle tools, there are not so many complex data dictionaries in MySQL, and it is relatively lighter in implementation, mainly for log mining. It is indeed commendable to be able to find some very effective information in a large and complex log.

Looking at Percona's series of products on the official website, you can see that one of Percona Toolkit's Logo looks like a deer dog.

If you look at the user manual, you can see that there are a lot of commands, if there is no classification or no direction.

Here to find colleagues before sharing, tools are classified as follows, respectively from the performance, configuration, monitoring, development, replication, system, practical point of view.

Performance

Pt-index-usage

Pt-pmp

Pt-visual-explain

Configuration

Pt-config-diff

Pt-variable-advisor

Pt-mysql-summary

Monitor and control

Pt-deadlock-logger

Pt-mext

Pt-query-digest

Pt-trend

Pt-fk-error-logger

Development

Pt-duplicate-key-checker

Pt-online-schema-change

Pt-query-advisor

Pt-show-grants

Pt-upgrade

Copy

Pt-heartbeat

Pt-slave-delay

Pt-slave-find

Pt-table-checksum

Pt-table-sync

System

Pt-diskstats

Pt-fifo-split

Pt-summary

Pt-stalk

Practical

Pt-archiver

Pt-find

Pt-kill

Of course, installation and configuration is the first step, and this step is also very simple.

Use wget percona.com/get/percona-toolkit.tar.gz to download, or download rpm packages from the official website, etc.

After downloading to the installation package, you also need to prepare some plug-ins for perl.

You can use yum to install.

Yum install perl-DBI-y

Yum install perl-DBD-MySQL-y

Yum install perl-Time-HiRes-y

Yum install perl-IO-Socket-SSL-y

The steps to install pt are just a few regular steps.

Perl Makefile.PL

Make

Make test

Make install

Here is a brief introduction to the use of several commands:

Pt-index-usage

Slow logs can be parsed in the following ways, and suggestions will be given for unused indexes. Of course, this part needs to be carefully considered, and the suggestions still depend on the log. The more abundant the capacity in the log is, the more persuasive the suggestion is. > pt-index-usage / home/mysql/slow.log

/ home/mysql/slow.log: 64% 00:50 remain

/ home/mysql/slow.log: 99% 00:00 remain

ALTER TABLE `_ gcsrecharge`.`ORDERS` DROP KEY `idx_orders_ gcsId`, DROP KEY `idx_orders_ transactionId`;-- type:non-unique

ALTER TABLE `usercenter`.`Pay _ ORDER_ XSOLLA` DROP KEY `ORDER_ ID`;-- type:non-unique

Pt-config-diff

This command can compare the differences in configuration files, such as the two files below, and all the differences are clear at a glance.

> pt-config-diff / etc/my.cnf / etc/my.cnfold

5 config differences

Variable / etc/my.cnf / etc/my.cnfold

=

Innodb_data_file_path ibdata1:1G:autoextend ibdata1:1024M:autoextend

Innodb_io_capacity 2000 1000

Innodb_max_dirty_pages... 50 20

Innodb_read_io_threads 8 4

Innodb_write_io_threads 8 4

Pt-mysql-summary

This command summarizes the configuration and status information of mysql and interprets it in several sections.

# pt-mysql-summary

# Percona Toolkit MySQL Summary Report #

System time | 2016-05-01 13:49:14 UTC (local TZ: EDT-0400)

# Instances #

Port Data Directory Nice OOM Socket

=

3306 / home/mysql 0 0 / home/mysql/mysql.sock

# MySQL Executable #

Path to executable | / usr/local/mysql/bin/mysqld

Has symbols | Yes

# Report On Port 3306 # #

User | root@localhost

Time | 2016-05-01 09:49:14 (EST)

Hostname | recharge_db

Version | 5.6.23-72.1-log Percona Server (GPL), Release 72.1, Revision 0503478

Built On | Linux x86x64

Started | 2015-12-16 05:40 (up 137mm 04 08bureau 49)

Databases | 8

Datadir | / home/mysql/

Processes | 50 connected, 3 running

Replication | Is not a slave, has 1 slaves connected

Pidfile | / home/mysql/mysql.pid (exists)

These are all the contents of the article "how to install and configure Percona-toolkit". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report