暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

redhat 6.8安装mysql运维利器GitHub percona-toolkit

lovedb 2019-11-17
233

目录

percona-toolkit工具概述


percona-toolkit工具官方手册


下载percona-toolkit


安装percona-toolkit


使用percona-toolkit工具



percona-toolkit工具概述

      percona-toolkit是一系列工具包的集合,运维mysql朋友的们一般都知道这个工具。其涵盖的功能非常广泛。

      其中包括分析诊断slow query,io性能分析依断,mysql性能瞬间抖动,具体其它功能,请大家自行研究官方手册。


percona-toolkit工具官方手册

https://www.percona.com/software/database-tools/percona-toolkit


下载percona-toolkit

https://github.com/percona/percona-toolkit/releases/tag/v3.1.0


安装percona-toolkit

  1.上传介质

    [root@three57 ~]# mkdir -p pt_tool_dir
    [root@three57 ~]# cd pt_tool_dir/
    [root@three57 pt_tool_dir]# ll
    总用量 24008
    -rw-r--r-- 1 root root 24583626 1113 11:24 percona-toolkit-3.1.0.tar.gz
    复制

      2.解压介质

      [root@three57 pt_tool_dir]# tar -zxvf percona-toolkit-3.1.0.tar.gz
      复制

       3.安装前提条件

        加载操作系统光盘
        [root@three57 ~]# rpm -qa|grep -i --color dbd
        perl-DBD-SQLite-1.27-3.el6.x86_64
        [root@three57 ~]# mount dev/cdrom mnt
        mount: block device dev/sr0 is write-protected, mounting read-only


        安装dbd-mysql
        [root@three57 ~]# cd mnt
        [root@three57 mnt]# cd Packages/
        [root@three57 Packages]# pwd
        /mnt/Packages
        [root@three57 Packages]# ls -l *DBD*
        -r--r--r-- 294 root root 137008 8月 17 2010 perl-DBD-MySQL-4.013-3.el6.x86_64.rpm
        -r--r--r-- 273 root root 201216 7月 24 2012 perl-DBD-Pg-2.15.1-4.el6_3.x86_64.rpm
        -r--r--r-- 294 root root 84724 8月 17 2010 perl-DBD-SQLite-1.27-3.el6.x86_64.rpm


        缺少包
        [root@three57 Packages]# rpm -ivh perl-DBD-MySQL-4.013-3.el6.x86_64.rpm
        warning: perl-DBD-MySQL-4.013-3.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
        error: Failed dependencies:
        libmysqlclient.so.16()(64bit) is needed by perl-DBD-MySQL-4.013-3.el6.x86_64
        libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by perl-DBD-MySQL-4.013-3.el6.x86_64


        已有包但版本低
        [root@three57 Packages]# locate libmysqlclient.so
        /usr/lib64/mysql/libmysqlclient.so.20
        /usr/lib64/mysql/libmysqlclient.so.20.3.8


        强制安装
        [root@three57 Packages]# rpm -ivh --nodeps perl-DBD-MySQL-4.013-3.el6.x86_64.rpm
        warning: perl-DBD-MySQL-4.013-3.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
        Preparing... ########################################### [100%]
        1:perl-DBD-MySQL ########################################### [100%]
        [root@three57 Packages]#
        复制


        4.安装

          [root@three57 pt_tool_dir]# ll
          总用量 24012
          drwxrwxr-x 10 root root 4096 9月 10 20:30 percona-toolkit-3.1.0
          -rw-r--r-- 1 root root 24583626 11月 13 11:24 percona-toolkit-3.1.0.tar.gz


          [root@three57 pt_tool_dir]# cd percona-toolkit-3.1.0
          [root@three57 percona-toolkit-3.1.0]# ll
          总用量 164
          drwxrwxr-x 2 root root 4096 9月 10 20:30 bin
          -rw-rw-r-- 1 root root 53417 9月 10 20:30 Changelog
          drwxrwxr-x 6 root root 4096 9月 10 20:30 config
          -rw-rw-r-- 1 root root 7142 9月 10 20:30 CONTRIBUTE.md
          -rw-rw-r-- 1 root root 224 9月 10 20:30 CONTRIBUTING.md
          -rw-rw-r-- 1 root root 18092 9月 10 20:30 COPYING
          -rw-rw-r-- 1 root root 8314 9月 10 20:30 docker-compose.yml
          drwxrwxr-x 4 root root 4096 9月 10 20:30 docs
          -rw-rw-r-- 1 root root 10133 9月 10 20:30 Gopkg.lock
          -rw-rw-r-- 1 root root 1350 9月 10 20:30 Gopkg.toml
          -rw-rw-r-- 1 root root 1527 9月 10 20:30 INSTALL
          drwxrwxr-x 6 root root 4096 9月 10 20:30 lib
          -rw-rw-r-- 1 root root 567 9月 10 20:30 Makefile.PL
          -rw-rw-r-- 1 root root 736 9月 10 20:30 MANIFEST
          -rw-rw-r-- 1 root root 1842 9月 10 20:30 README.md
          drwxrwxr-x 4 root root 4096 9月 10 20:30 sandbox
          drwxrwxr-x 3 root root 4096 9月 10 20:30 src
          drwxrwxr-x 35 root root 4096 9月 10 20:30 t
          drwxrwxr-x 3 root root 4096 9月 10 20:30 util
          [root@three57 percona-toolkit-3.1.0]#




          [root@three57 percona-toolkit-3.1.0]# perl Makefile.PL
          Writing Makefile for percona-toolkit
          [root@three57 percona-toolkit-3.1.0]#




          [root@three57 percona-toolkit-3.1.0]# make




          [root@three57 percona-toolkit-3.1.0]# make test




          [root@three57 percona-toolkit-3.1.0]# make install


          复制


          使用percona-toolkit工具

            root@three57 percona-toolkit-3.1.0]# pt-summary 
            # Percona Toolkit System Summary Report ######################
            Date | 2019-11-13 03:42:59 UTC (local TZ: CST +0800)
            Hostname | three57
            Uptime | 3 days, 15:41, 4 users, load average: 0.16, 0.24, 0.35
            System | innotek GmbH; VirtualBox; v1.2 (Other)
            Service Tag | 0
            Platform | Linux
            Release | Red Hat Enterprise Linux Server release 6.8 (Santiago)
            Kernel | 2.6.32-642.el6.x86_64
            Architecture | CPU = 64-bit, OS = 64-bit
            Threading | NPTL 2.12
            Compiler | GNU CC version 4.4.7 20120313 (Red Hat 4.4.7-17).
            SELinux | Disabled
            Virtualized | KVM
            # Processor ##################################################
            Processors | physical = 1, cores = 1, virtual = 1, hyperthreading = no
            Speeds | 1x3095.998
            Models | 1xIntel(R) Core(TM) i7-7920HQ CPU @ 3.10GHz
            Caches | 1x8192 KB
            # Memory #####################################################
            Total | 1.8G
            Free | 874.0M
            Used | physical = 1004.1M, swap allocated = 5.6G, swap used = 0.0, virtual = 1004.1M
            Shared | 3.3M
            Buffers | 97.5M
            Caches | 461.5M
            Dirty | 72 kB
                   后续内容略
            复制


            延伸阅读

            percona toolkit pt-variable-advisor验证mysql variable是否配置合理

            redhat 6.5 deploying percona toolkit 3.0.9 pt-mysql-summary


            联系方式


            文章转载自lovedb,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

            评论