解决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
相关推荐
博一波14 小时前
Redis AOF 持久化:银行的 “交易流水单” 管理逻辑
数据库·redis
老邓计算机毕设14 小时前
Springboot乐家流浪猫管理系统16lxw(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。
数据库·spring boot·后端
每天进步一点_JL14 小时前
InnoDB 存储引擎深度解析:从 B+ 树到全文索引的底层实现
数据库
未来影子15 小时前
系统炸了?数据库单表存了七十亿条数据
数据库
麦兜*15 小时前
MongoDB 高可用部署:Replica Set 搭建与故障转移测试
java·数据库·spring boot·后端·mongodb·spring cloud·系统架构
DemonAvenger15 小时前
分库分表实战:应对数据增长的扩展策略
数据库·sql·性能优化
keep__go15 小时前
postgresql9.2.4 离线安装
linux·运维·数据库·postgresql
IvorySQL15 小时前
当数据库宕机时,PostgreSQL 高可用在背后做了什么?
数据库·postgresql
盒马coding15 小时前
PostgreSQL与SQL Server:B树索引差异及去重的优势
数据库·postgresql
^辞安15 小时前
MVCC是如何工作的?
数据库·oracle·mvcc