ocp 资源统计

ocp 某个集群—》资源管理–》已分配内存、已分配cpu
这个些信息里的,cpu总核数、和内存总GB数,是从哪个表里获取的。
oceanbase 3.2.4

使用企业版可以直接联系你们对口的技术支持人员

:sweat_smile:

4.x GV$OB_SERVERS

__all_server ,__all_virtual_server_stat 。 这是几个

1 个赞

考试个证吧。 实验材料里面都有

select zone,
concat(svr_ip, ‘:’, svr_port) observer,
cpu_capacity,
cpu_total,
cpu_assigned,
cpu_assigned_percent,
mem_capacity,
mem_total,
mem_assigned,
mem_assigned_percent,
unit_Num,
round(‘load’, 2) ‘load’,
round(‘cpu_weight’, 2) ‘cpu_weight’,
round(‘memory_weight’, 2) ‘mem_weight’,
leader_count
from __all_virtual_server_stat
order by zone, svr_ip;

1 个赞

谢谢!

谢谢

语法有问题,无法执行

用这个吧
SELECT a.zone,concat(a.svr_ip,’:’,a.svr_port) observer, cpu_total, cpu_assigned, (cpu_total-cpu_assigned) cpu_free,
mem_total/1024/1024/1024 mem_total_gb,
mem_assigned/1024/1024/1024 mem_assign_gb,
(mem_total-mem_assigned)/1024/1024/1024 mem_free_gb
FROM __all_virtual_server_stat a
JOIN __all_server b ON (a.svr_ip=b.svr_ip
AND a.svr_port=b.svr_port)
ORDER BY a.zone,
a.svr_ip ;