【 使用环境 】测试环境
【 OB or 其他组件 】ob
【 使用版本 】4.3
【问题描述】执行update更新语句,更新给大表(2亿条记录)的数据时,提示磁盘不够。但是在云平台看60/180,也仅使用了三分之一。这是为什么呢?
sql语句:
监控:
机器空间:
【 使用环境 】测试环境
【 OB or 其他组件 】ob
【 使用版本 】4.3
【问题描述】执行update更新语句,更新给大表(2亿条记录)的数据时,提示磁盘不够。但是在云平台看60/180,也仅使用了三分之一。这是为什么呢?
sql语句:
从这个目录看 软件目录、数据文件目录、事务日志目录都在一个文件系统下了。
先删除一下 /home/admin/oceanbase/log/observer.log.2024* 文件快速恢复。
或者通过设置ob 集群参数去自动清理。
alter system set enable_syslog_recycle=true;
alter system set max_syslog_file_count=100;
后面这个数字根据实际空间大小调整。
除了上面步骤外,还要查询一下租户的资源。OCP 集群里有个资源管理页面可以直观说明,或者用下面SQL 也行。
select zone,concat(SVR_IP,':',SVR_PORT) observer,
cpu_capacity_max cpu_total,cpu_assigned_max cpu_assigned,
cpu_capacity-cpu_assigned_max as cpu_free,
round(memory_limit/1024/1024/1024,2) as memory_total,
round((memory_limit-mem_capacity)/1024/1024/1024,2) as system_memory,
round(mem_assigned/1024/1024/1024,2) as mem_assigned,
round((mem_capacity-mem_assigned)/1024/1024/1024,2) as memory_free,
round(log_disk_capacity/1024/1024/1024,2) as log_disk_capacity,
round(log_disk_assigned/1024/1024/1024,2) as log_disk_assigned,
round((log_disk_capacity-log_disk_assigned)/1024/1024/1024,2) as log_disk_free,
round((data_disk_capacity/1024/1024/1024),2) as data_disk,
round((data_disk_in_use/1024/1024/1024),2) as data_disk_used,
round((data_disk_capacity-data_disk_in_use)/1024/1024/1024,2) as data_disk_free
from gv$ob_servers;
select t1.name resource_pool_name, t2.`name` unit_config_name,
t2.max_cpu, t2.min_cpu,
round(t2.memory_size/1024/1024/1024,2) mem_size_gb,
round(t2.log_disk_size/1024/1024/1024,2) log_disk_size_gb, t2.max_iops,
t2.min_iops, t3.unit_id, t3.zone, concat(t3.svr_ip,':',t3.`svr_port`) observer,
t4.tenant_id, t4.tenant_name
from __all_resource_pool t1
join __all_unit_config t2 on (t1.unit_config_id=t2.unit_config_id)
join __all_unit t3 on (t1.`resource_pool_id` = t3.`resource_pool_id`)
left join __all_tenant t4 on (t1.tenant_id=t4.tenant_id)
order by t1.`resource_pool_id`, t2.`unit_config_id`, t3.unit_id;
这一步是看资源情况,找不合理之处或可以扩容资源的地方。
并不分析直接原因。
集群是1-1-1数据空间够用,但是系统磁盘空间不足,先按照上面教的删除log日志紧急恢复一下
版本号: 4.2.2-20240108
ob是与预占用磁盘的吧,并且集群中每个节点有180G,仅使用了60G
”从这个目录看 软件目录、数据文件目录、事务日志目录都在一个文件系统下了“
是的,都在一起了。
看了日志文件目录:/home/admin/oceanbase/log/ 已用 1.4G,系统还有13G空间
是预分配的,详细看下如下两篇文章,你可以点进去相应的observer(observer IP)可以看到服务器磁盘监控
https://open.oceanbase.com/blog/7588418336
https://open.oceanbase.com/blog/6618798960
OB的数据盘使用空间默认是只能使用到91%的,并不会把你分配的磁盘空间全部使用完,如果要全部使用需要调整参数data_disk_usage_limit_percentage的阈值,具体可以看官方说明https://www.oceanbase.com/docs/common-oceanbase-database-cn-1000000000821164