GBase 8a
运维管理
文章

zabbix监控GBase 8a 的指标项

发表于2025-03-15 15:00:5750次浏览1个评论
1集群运行状态gcadmin|grep "CLUSTER STATE"
2集群模式gcadmin showcluster vc vc1|grep "VIRTUAL CLUSTER MODE"
3集群类型gcadmin show_gcware_mode
4GCluster服务状态gcadmin | grep coordinator | grep -vE "COORDINATOR CLUSTER|coordinator node"|awk -F '|' '{print $4}'
5GCluster数据一致性状态gcadmin | grep -i coordinator | grep -vE "COORDINATOR CLUSTER|coordinator node"|awk -F '|' '{print $5}'
6GCware服务状态gcadmin | grep gcware |grep -vE "NodeName" |awk -F '|' '{print $4}'
7GNode服务状态gcadmin showcluster vc vc1|grep node |grep -vE "NodeName"|awk -F '|' '{print $5}'
8GNode数据一致性状态gcadmin showcluster vc vc1|grep node |grep -vE "NodeName"|awk -F '|' '{print $7}'
9Syncserver服务状态gcadmin showcluster vc vc1|grep node |grep -vE "NodeName"|awk -F '|' '{print $6}'
10DDLevent数量gcadmin showddlevent f
然后需要抓取数量
11DMLevent数量gcadmin showdmlevent
同上
12DMLStorageevent数量gcadmin showdmlstorageevent
同上
13failover数量gcadmin showfailover f
然后需要抓取数量
14被takeover的failover数量gcadmin showfailover f
然后需要抓取takeover_number的值>0的数量
15集群锁总数gcadmin showlock f
然后需要抓取数量
16集群日志等级gbase> show variables like 'gcluster_log_level';
17集群详细版本gbase> show variables like '%version';
18会话连接数select count(*) from information_schema.COORDINATORS_TASK_INFORMATION where command not in ('Daemon','CTQ','GNS');
19活跃会话数select count(*) from information_schema.coordinators_task_information where command in ('Query');
20平均SQL执行时间select t1.totalTime,t2.totalNum from (select sum(time) as totalTime from information_schema.COORDINATORS_TASK_INFORMATION where command not in ('Daemon','CTQ','GNS') and info like 'select%') as t1,(select count(*) as totalNum from information_schema.COORDINATORS_TASK_INFORMATION where command not in ('Daemon','CTQ','GNS') and info like 'select%') as t2;
21ddl 数量select sql_type,count(*) as nums from gbase.audit_log group by sql_type;
22dml 数量select sql_type,count(*) as nums from gbase.audit_log group by sql_type;
23dql 数量select sql_type,count(*) as nums from gbase.audit_log group by sql_type;
24处于checking permission状态的SQL数量select count(*)  from information_schema.processlist where command='checking permissions';
25处于killed状态的SQL数量select count(*)  from information_schema.processlist where command='killed';
26SQL临时空间使用量select sum(temp_space) from performance_schema.SESSION_MEMORY_USAGE_INFO;
27data堆内存使用率select USED_IN_HEAP/HEAP_SIZE from performance_schema.HEAP_USAGE_INFO where heap_type='dc_heap';
28large堆内存使用率select USED_IN_HEAP/HEAP_SIZE from performance_schema.HEAP_USAGE_INFO where heap_type='large_heap';
29temp堆内存使用率select USED_IN_HEAP/HEAP_SIZE from performance_schema.HEAP_USAGE_INFO where heap_type='temp_heap';
30元数据内存占用大小show status like 'express_cached_metadata';
31gnode 节点 query 类型的 process 数量select count(*)  from information_schema.processlist where command='query' and time>0;
32集群 query 类型 sql 执行时长异常数量select count(*) from information_schema.COORDINATORS_TASK_INFORMATION where time >[设置阈值];
33kafka运行状态监控gc节点执行select count(*) from information_schema.kafka_consumer_status where length(exception) >1;

评论

登录后才可以发表评论
沉香发表于 2个月前
向大佬学习