解决orzdba采集数据库性能指标不全的问题

背景

调试数据库的性能指标采集工具orzdba,发现它生成的指标文件内容与正常的不全,如文件 /tmp/orzdba/192.168.1.1_3306_20250327.log 的内容如下:

python 复制代码
--------                                -QPS-    -TPS-            -Hit%- --------------threads--------------- -------bytes------ 
  time  |  ins&rep      upd      del      sel     iudr|     lor      hit|      run      con      cre      cac|     recv     send|
01:42:42|        0        0        0        0        0|       0   100.00|        1        1        0       12|    1.03K    1.28K|
01:42:43|        0        0        0        0        0|       0   100.00|        1        1        0       12|    1.06K    1.32K|
01:42:44|        0        0        0        0        0|       0   100.00|        1        1        0       12|    1.05K    1.32K|
01:42:45|        0        0        0        0        0|       0   100.00|        1        1        0       12|    1.06K    1.32K|
01:42:46|        0        0        0        0        0|       0   100.00|        1        1        0       12|    1.06K    1.32K|
01:42:47|        0        0        0        0        0|       0   100.00|        1        1        0       12|    1.06K    1.32K|
01:42:48|        0        0        0        0        0|       0   100.00|        1        1        0       12|    1.06K    1.32K|

正常的采集指标内容为:

python 复制代码
-------- ----------load-avg--------- ----cpu-usage--- ----------------------------------------io-usage----------------------------------------                                -QPS-    -TPS-            -Hit%- ---------innodb rows status--------- -------innodb bp pages status------- ----------innodb data status-------- ----innodb log----       his ----log(byte)----     read ------query------ --------------threads--------------- -------bytes------ ------innodb row lock------ ----table lock---- 
  time  |       1m       5m      15m| usr sys idl iow|      r/s      w/s     rB/s     wB/s     r_rt     w_rt    queue    await    svctm %util|  ins&rep      upd      del      sel     iudr|     lor      hit|      ins      upd      del     read|     data     free    dirty    flush|    reads   writes     read  written|   fsyncs  written|     list   uflush    uckpt     view   inside      que|      run      con      cre      cac|     recv     send| cur_wait     time    waits|      imd     wait|
01:26:02|     1.72     3.76     5.59|   2   0  98   0|     0.40     5.19    5.95K   73.55K   230.77    23.95      0.0      0.0      0.2   0.1|
01:26:03|     1.72     3.76     5.59|   4   0  96   0|     0.59     4.41    8.50K   64.34K   210.53    21.13      0.0      0.0      0.3   0.1|
01:26:04|     1.72     3.76     5.59|   3   0  97   0|     0.62     4.54    9.35K   52.31K      200    20.55      0.0      0.0      0.2   0.1|
01:26:05|     1.82     3.75     5.57|   5   1  94   0|     0.25     5.16    3.16K   83.88K      250    24.10      0.0      0.0      0.2   0.1|
01:26:06|     1.82     3.75     5.57|   2   0  98   0|     0.25     1.77    3.88K   36.65K      250    35.09      0.0      0.1      0.4   0.1|

排查:

单独跑了一下脚本,发现有报错:

python 复制代码
# /usr/bin/perl /export/servers/orzdba 3306 -monitor -nocolor
sh: lvdisplay: command not found
sh: lvdisplay: command not found
awk: cmd. line:1: {if($1== && $2==) print $3}
awk: cmd. line:1:          ^ syntax error
awk: cmd. line:1: {if($1== && $2==) print $3}
awk: cmd. line:1:                 ^ syntax error

原来是系统内缺少lvm2包,安装命令如下:

python 复制代码
yum install lvm2
相关推荐
wangbaowo7 分钟前
MySQL数据库下篇
数据库·经验分享·笔记·学习·mysql·安全
ABdolphin9 分钟前
Spring-博客系统项目
数据库·sql·spring
伤不起bb16 分钟前
MySQl 数据库操作
数据库·mysql
是店小二呀1 小时前
【金仓数据库征文】金仓数据库(KingbaseES)迁移与集群部署实战:从MySQL到KES的全流程解析
数据库·mysql·金仓数据库 2025 征文·数据库平替用金仓
一只专注api接口开发的技术猿1 小时前
1688 API 自动化采集实践:商品详情实时数据接口开发与优化
大数据·运维·数据库·自动化
昔我往昔1 小时前
MySQL中为什么使用B+树结构、B+树和普通的平衡树的区别
数据库·b树·mysql
翁正存2 小时前
MySQL为什么选择B+树
数据库·b树·mysql
码农黛兮_462 小时前
MySQL 数据库集群部署、性能优化及高可用架构设计
数据库·mysql·性能优化
AllenO.o3 小时前
Redis五种数据结构详解
java·数据结构·数据库·redis·缓存
消失在人海中3 小时前
数据分析基础:需要掌握的入门知识
数据库·人工智能·数据分析