Centos 安装Percona Toolkit工具集

1、下载

下载地址:   https://www.percona.com/downloads/percona-toolkit/LATEST/

[[email protected] ~]# wget https://www.percona.com/downloads/percona-toolkit/3.0.13/binary/redhat/7/x86_64/percona-toolkit-3.0.13-re85ce15-el7-x86_64-bundle.tar

2、安装

[[email protected] ~]# rpm -ivh percona-toolkit-3.0.13-1.el7.x86_64.rpm
warning: percona-toolkit-3.0.13-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 8507efa5: NOKEY
error: Failed dependencies:
        perl(DBI) >= 1.13 is needed by percona-toolkit-3.0.13-1.el7.x86_64
        perl(DBD::mysql) >= 1.0 is needed by percona-toolkit-3.0.13-1.el7.x86_64
        perl(IO::Socket::SSL) is needed by percona-toolkit-3.0.13-1.el7.x86_64

缺少 perl-DBI   perl-DBD-MySQL  perl-IO-Socket-SSL 依赖包,通过yum安装即可

再次安装 percona-toolkit-3.0.13-1.el7.x86_64.rpm

[[email protected] ~]# rpm -ivh percona-toolkit-3.0.13-1.el7.x86_64.rpm
warning: percona-toolkit-3.0.13-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 8507efa5: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:percona-toolkit-3.0.13-1.el7     ################################# [100%]

3、检验安装结果

[[email protected] ~]# pt-duplicate-key-checker --help
pt-duplicate-key-checker examines MySQL tables for duplicate or redundant
indexes and foreign keys.  Connection options are read from MySQL option files.
For more details, please use the --help option, or try ‘perldoc
/usr/bin/pt-duplicate-key-checker‘ for complete documentation.

Usage: pt-duplicate-key-checker [OPTIONS] [DSN]

Options:

  --all-structs         Compare indexes with different structs (BTREE, HASH,
                        etc)
  --ask-pass            Prompt for a password when connecting to MySQL
  --charset=s       -A  Default character set
  --[no]clustered       PK columns appended to secondary key is duplicate (
                        default yes)
  --config=A            Read this comma-separated list of config files; if
                        specified, this must be the first option on the command
                        line
  --databases=h     -d  Check only this comma-separated list of databases
  --defaults-file=s -F  Only read mysql options from the given file
  --engines=h       -e  Check only tables whose storage engine is in this comma-
                        separated list
  --help                Show help and exit
  --host=s          -h  Connect to host
  --ignore-databases=H  Ignore this comma-separated list of databases
  --ignore-engines=H    Ignore this comma-separated list of storage engines
  --ignore-order        Ignore index order so KEY(a,b) duplicates KEY(b,a)
  --ignore-tables=H     Ignore this comma-separated list of tables
  --key-types=s         Check for duplicate f=foreign keys, k=keys or fk=both (
                        default fk)
  --password=s      -p  Password to use when connecting
  --pid=s               Create the given PID file
  --port=i          -P  Port number to use for connection
  --set-vars=A          Set the MySQL variables in this comma-separated list of
                        variable=value pairs
  --socket=s        -S  Socket file to use for connection
  --[no]sql             Print DROP KEY statement for each duplicate key (
                        default yes)
  --[no]summary         Print summary of indexes at end of output (default yes)
  --tables=h        -t  Check only this comma-separated list of tables
  --user=s          -u  User for login if not current user
  --verbose         -v  Output all keys and/or foreign keys found, not just
                        redundant ones
  --version             Show version and exit
  --[no]version-check   Check for the latest version of Percona Toolkit, MySQL,
                        and other programs (default yes)

Option types: s=string, i=integer, f=float, h/H/a/A=comma-separated list, d=DSN, z=size, m=time

Rules:

  This tool accepts additional command-line arguments. Refer to the SYNOPSIS and usage information for details.

DSN syntax is key=value[,key=value...]  Allowable DSN keys:

  KEY  COPY  MEANING
  ===  ====  =============================================
  A    yes   Default character set
  D    yes   Default database
  F    yes   Only read default options from the given file
  P    yes   Port number to use for connection
  S    yes   Socket file to use for connection
  h    yes   Connect to host
  p    yes   Password to use when connecting
  u    yes   User for login if not current user

  If the DSN is a bareword, the word is treated as the ‘h‘ key.

Options and values after processing arguments:

  --all-structs         FALSE
  --ask-pass            FALSE
  --charset             (No value)
  --clustered           TRUE
  --config              /etc/percona-toolkit/percona-toolkit.conf,/etc/percona-toolkit/pt-duplicate-key-checker.conf,/root/.percona-toolkit.conf,/root/.pt-duplicate-key-checker.conf
  --databases           (No value)
  --defaults-file       (No value)
  --engines             (No value)
  --help                TRUE
  --host                (No value)
  --ignore-databases
  --ignore-engines
  --ignore-order        FALSE
  --ignore-tables
  --key-types           fk
  --password            (No value)
  --pid                 (No value)
  --port                (No value)
  --set-vars
  --socket              (No value)
  --sql                 TRUE
  --summary             TRUE
  --tables              (No value)
  --user                (No value)
  --verbose             FALSE
  --version             FALSE
  --version-check       TRUE

原文地址:https://www.cnblogs.com/splendid/p/10283890.html

时间: 2025-01-02 15:47:00

Centos 安装Percona Toolkit工具集的相关文章

pt(Percona Toolkit)工具详解:(一)安装

pt(Percona Toolkit)工具是由Percona公司开发的一个用perl语言编写的工具集,包含很多功能,例如在线更改数据表结构,校验主从数据,检查数据库状态,分析慢查询等这些靠人手做起来比较麻烦的事情,功能强大,操作简单. 安装 既然是perl语言开发的工具集,那当然是先安装perl相关依赖包了 yum install -y perl perl-IO-Socket-SSL perl-DBD-MySQL perl-Time-HiRes perl-Digest-MD5 然后,就到下面这个

CentOS 安装Percona

先安装Percona的Yum库源 yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm 执行安装命令 yum install Percona-Server-client-56 Percona-Server-server-56

centos 安装atop& htop工具

首先安装rpmforge   Install RPM for CentOS 5.x 32-BIT wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.i686.rpmrpm -Uhv rpmforge-release*.rf.i386.rpm 64BIT wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5

centos 安装 redis3.0.0 集群

这里创建6个redis节点,其中三个为主节点,三个为从节点. redis和端口对应关系: 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 从: 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005 步骤: 1,下载redis.官网下载3.0.0版本,之前几的版本不支持集群模式 下载地址:http://download.redis.io/releases/redis-3.0.0.tar.gz 2:上传服务器,解压,编译

centos 安装 redis3.2.0 集群

这里创建6个redis节点,其中三个为主节点,三个为从节点. redis和端口对应关系: 127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 从: 127.0.0.1:7003127.0.0.1:7004127.0.0.1:7005 步骤:1,下载redis.官网下载3.0.0版本,之前几的版本不支持集群模式 下载地址:http://download.redis.io/releases/redis-3.0.0.tar.gz 2:上传服务器,解压,编译tar

Linux CentOS安装Azure Cli工具

vim /etc/yum.repos.d/epel.repo [epel] name=epel baseurl=http://mirrors.sohu.com/fedora-epel/6/$basearch enabled=1 gpgcheck=0 用yum安装nodejs和npm软件: yum install nodejs -y yum install npm -y 编辑 ~/.npmrc 加入下面内容: registry = http://registry.cnpmjs.org 然后安装az

CentOS安装VirtualBox增强工具

安装过程中出现错误: Bulding the VirtualBox Guest Additions Kernel modules failedYour system does not seem to be set up to build kernel modules.Look at /var/log/vboxadd-install.log to find out what went worg. Once you have corrected it,you run/etc/init.d/vboxa

在aliyun主机上通过yum方式安装Percona版MYSQL 5.7

Aliyun主机环境:CPU:1C  MEM:2G   OS:centos 6.8 1.安装percona软件包源 yum install http://www.percona.com/downloads/percona-release/redhat/0.1-4/percona-release-0.1-4.noarch.rpm 2.验证percona软件包源 yum  list | grep Percona-Server-server-57 3.安装mysql 5.7 yum install P

yum 安装percona xtrabackup

centos5.6下配置percona的yum仓库并安装xtrabackup工具 一.先安装依赖: yum install perl-DBI yum install perl-DBD-MySQL yum install perl-Time-HiRes yum install perl-IO-Socket-SSL 二.配置yum源. 方法1.自动安装percona的yum仓库(以下分别为x86_64和i386平台) #rpm -ivh http://www.percona.com/download