yxixi 发表于 2018-9-28 11:48:42

mysql工具innotop安装

  INNOTOP是一个通过文本模式显示MySQL和 InnoDB的监测工具。它有很多特点,快速的配置的,易于使用等。它吸取了MYTOP的精华这使它变得更加强大。INNOTOP是用PERL语言写成 的,这是它能更加灵活的使用在各种操作平台之上,它能详细的的监控出当前MYSQL和INNODB运行的状态,以便维护人员根据结果合理的优化 MYSQL,让MYSQL更稳定更高效的运行。
  安装INNOTOP工具非常的简单,既然是由PERL写的,当然需要PERL环境和相关的工具包。
  1、下载innotop的源码包,可以从
  http://code.google.com/p/innotop/downloads/list
  http://internap.dl.sourceforge.net/sourceforge/innotop 下载 源码包,下载之后可以解压
  tar-zxvf innotop-1.8.0\ \(1\).tar.gz
  cd innotop-1.8.0 进入目录之后可以查看文件,可以查看 INSTALL 文件查看安装步骤。
  perl Makefile.PL
  如果innotop 需要的perl 模块没有安装全就会报错,然后通过
  cpan -i modulename 安装需要模块之后,重新执行perl Makefile.PL
  如果没有报错 然后 使用make install 安装 innotop。
  安装之后系统就会多出一个命令,innotop
  #innotop–help 就会看到
  # innotop–help
  Usage: innotop
  –color   -C   Use terminal coloring (default)
  –config      -c   Config file to read
  –count            Number of updates before exiting
  –delay       -d   Delay between updates in seconds
  –help             Show this help message
  –host      -h   Connect to host
  –inc   -i   Measure incremental differences
  –mode      -m   Operating mode to start in
  –nonint      -n   Non-interactive, output tab-separated fields
  –password    -p   Password to use for connection
  –port      -P   Port number to use for connection
  –skipcentral -s   Skip reading the central configuration file
  –socket      -S   MySQL socket to use for connection
  –timestamp   -t   Print timestamp in -n mode (1: per iter; 2: per line)
  –user      -u   User for login if not current user
  –version          Output version information and exit
  –write       -w   Write running configuration into home directory if no config files were loaded
  加上需要的参数就可以监控mysql 。
  如# innotop-uuser -ppassword-S sock路径
  就会看到
   Query List (? for help)                              localhost, 3+22:33:35.004, 0.74 QPS, 3/1/19 con/run/cac thds, 5.1.50-log
  When   LoadQPS   SlowSe/In/Up/De%QCacheHitKCacheHitBpsInBpsOut
  Total0.000.74   058/ 0/14/ 0      57.71%   99.75%45.60454.74

  Cmd   >  然后输入? 帮助
  Switch to a different mode:
  BInnoDB Buffers    LLocks               RInnoDB Row Ops
  CCommand Summary   MReplication StatusSVariables & Status
  DInnoDB DeadlocksOOpen Tables         TInnoDB Txns
  FInnoDB FK Err   QQuery List          UUser Statistics
  IInnoDB I/O Info
  Actions:
  aToggle the innotop process    kKill a query’s connection
  cChoose visible columns      nSwitch to the next connection
  dChange refresh interval       pPause innotop
  eExplain a thread’s query      qQuit innotop
  fShow a thread’s full query    rReverse sort order
  hToggle the header on and offsChange the display’s sort column

  iToggle>  Other:
  TABSwitch to the next server group   /Quickly filter what you see
  !Show license and warranty         =Toggle aggregation
  #Select/create server groups       @Select/create server connections
  $Edit configuration settings       \Clear quick-filters
  Press any key to continue
  根据上面的提示查看mysql 的各种状态。希望你能找到影响性能的瓶颈。

页: [1]
查看完整版本: mysql工具innotop安装