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

Pt (Percona Toolkit) tool installation

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Pt (Percona Toolkit) tool installation

PT (Percona Toolkit) tool is a tool set written in Perl language developed by Percona, which contains many functions, such as changing data table structure online, verifying master and slave data, checking database status, analyzing slow queries and so on. It is powerful and easy to operate.

two。 Install dependency packages

Yum install-y perl perl-IO-Socket-SSL perl-DBD-MySQL perl-Time-HiRes perl-Digest-MD5 perl-ExtUtils-MakeMaker

Download the Percona Toolkit tool compilation package

[root@node1 ~] # wget "https://www.percona.com/downloads/percona-toolkit/3.0.3/binary/tarball/percona-toolkit-3.0.3_x86_64.tar.gz"

Decompression

[root@node1 ~] # tar xf percona-toolkit-3.0.3_x86_64.tar.gz

Go to the directory to install

[root@node1 ~] # cd percona-toolkit-3.0.3

Start compilation and installation

[root@node1 percona-toolkit-3.0.3] # perl Makefile.PL

[root@node1 percona-toolkit-3.0.3] # make

[root@node1 percona-toolkit-3.0.3] # make install

It shows some commonly used pt commands

[root@node1 ~] # ll / usr/local/bin/pt-*

-r-xr-xr-x 1 root root 41753 Oct 2 22:02 / usr/local/bin/pt-align

-r-xr-xr-x 1 root root 264365 Oct 2 22:02 / usr/local/bin/pt-archiver

-r-xr-xr-x 1 root root 169286 Oct 2 22:02 / usr/local/bin/pt-config-diff

-r-xr-xr-x 1 root root 166482 Oct 2 22:02 / usr/local/bin/pt-deadlock-logger

-r-xr-xr-x 1 root root 165199 Oct 2 22:02 / usr/local/bin/pt-diskstats

-r-xr-xr-x 1 root root 169478 Oct 2 22:02 / usr/local/bin/pt-duplicate-key-checker

-r-xr-xr-x 1 root root 50163 Oct 2 22:02 / usr/local/bin/pt-fifo-split

-r-xr-xr-x 1 root root 149999 Oct 2 22:02 / usr/local/bin/pt-find

-r-xr-xr-x 1 root root 67310 Oct 2 22:02 / usr/local/bin/pt-fingerprint

-r-xr-xr-x 1 root root 133459 Oct 2 22:02 / usr/local/bin/pt-fk-error-logger

-r-xr-xr-x 1 root root 219308 Oct 2 22:02 / usr/local/bin/pt-heartbeat

-r-xr-xr-x 1 root root 226592 Oct 2 22:02 / usr/local/bin/pt-index-usage

-r-xr-xr-x 1 root root 32411 Oct 2 22:02 / usr/local/bin/pt-ioprofile

-r-xr-xr-x 1 root root 250986 Oct 2 22:02 / usr/local/bin/pt-kill

-r-xr-xr-x 1 root root 21876 Oct 2 22:02 / usr/local/bin/pt-mext

-r-xr-xr-x 1 root root 6402784 Oct 2 22:02 / usr/local/bin/pt-mongodb-query-digest

-r-xr-xr-x 1 root root 6596000 Oct 2 22:02 / usr/local/bin/pt-mongodb-summary

-r-xr-xr-x 1 root root 102146 Oct 2 22:02 / usr/local/bin/pt-mysql-summary

-r-xr-xr-x 1 root root 399567 Oct 2 22:02 / usr/local/bin/pt-online-schema-change

-r-xr-xr-x 1 root root 24660 Oct 2 22:02 / usr/local/bin/pt-pmp

-r-xr-xr-x 1 root root 521606 Oct 2 22:02 / usr/local/bin/pt-query-digest

-r-xr-xr-x 1 root root 75986 Oct 2 22:02 / usr/local/bin/pt-show-grants

-r-xr-xr-x 1 root root 37790 Oct 2 22:02 / usr/local/bin/pt-sift

-r-xr-xr-x 1 root root 145825 Oct 2 22:02 / usr/local/bin/pt-slave-delay

-r-xr-xr-x 1 root root 129838 Oct 2 22:02 / usr/local/bin/pt-slave-find

-r-xr-xr-x 1 root root 182243 Oct 2 22:02 / usr/local/bin/pt-slave-restart

-r-xr-xr-x 1 root root 73082 Oct 2 22:02 / usr/local/bin/pt-stalk

-r-xr-xr-x 1 root root 90795 Oct 2 22:02 / usr/local/bin/pt-summary

-r-xr-xr-x 1 root root 424922 Oct 2 22:02 / usr/local/bin/pt-table-checksum

-r-xr-xr-x 1 root root 399440 Oct 2 22:02 / usr/local/bin/pt-table-sync

-r-xr-xr-x 1 root root 247137 Oct 2 22:02 / usr/local/bin/pt-table-usage

-r-xr-xr-x 1 root root 331255 Oct 2 22:02 / usr/local/bin/pt-upgrade

-r-xr-xr-x 1 root root 177292 Oct 2 22:02 / usr/local/bin/pt-variable-advisor

-r-xr-xr-x 1 root root 102551 Oct 2 22:02 / usr/local/bin/pt-visual-explain

Even if the installation is finished, it is very simple.

For a test, the status of the MySQL service shows:

[root@node1] # pt-mysql-summary-- user=root-- password='abc123'

Mysql: [Warning] Using a password on the command line interface can be insecure.

# Percona Toolkit MySQL Summary Report #

System time | 2017-10-03 05:03:34 UTC (local TZ: PDT-0700)

# Instances #

Port Data Directory Nice OOM Socket

=

/ var/lib/mysql 0 0 / var/lib/mysql/mysql.sock

# MySQL Executable #

Path to executable | / usr/sbin/mysqld

Has symbols | Yes

# Report On Port 3306 # #

User | root@localhost

Time | 2017-10-02 22:03:34 (PDT)

Hostname | node1

Version | 5.7.19-log MySQL Community Server (GPL)

Built On | Linux x86x64

Started | 2017-10-02 03:48 (up 0118pur1533)

Databases | 8

Datadir | / var/lib/mysql/

Processes | 1 connected, 1 running

Replication | Is not a slave, has 0 slaves connected

Pidfile | / var/run/mysqld/mysqld.pid (exists)

# Processlist #

After a long string, omitted here, the test runs normally.

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: 215

*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