设备有足够的物理资源,但创建资源池失败

【产品名称】oceanbase

【产品版本】 OceanBase 3.1.0 

【问题描述】

  1. 设备物理资源:内存:100G; 磁盘:1T;core num:144
  2. 创建资源单元:create resource unit sysbench_unit max_cpu 96, max_memory 60000000000, max_iops 128, max_disk_size 53687091200, max_session_num 64, MIN_CPU=26, MIN_MEMORY=60000000000, MIN_IOPS=128;
  3. 创建资源池:create resource pool sysbench_pool unit = 'sysbench_unit', unit_num = 1, zone_list=('zone1');   
  4. error : machine resource 'zone1' is not enough to hold a new unit
  5. 缩减资源单元大小,资源池创建成功。
  6. oceanbase 配置: memory_limit: 80G ;datafile_disk_percentage: 30  

所以,oceanbase判断设备资源是否够用的依据是什么,在物理资源明明够用的情况下,创建资源池频繁出错。


oceanbase是单机部署,配置资源单元时,缩减内存值,资源池才能创建成功。否则一直失败。

2 个赞

结合下面两个语句可以查看

查看总的资源:

select a.zone,concat(a.svr_ip,':',a.svr_port) observer, cpu_total, (cpu_total-cpu_assigned) cpu_free, round(mem_total/1024/1024/1024) mem_total_gb, round((mem_total-mem_assigned)/1024/1024/1024) mem_free_gb, usec_to_time(b.last_offline_time) last_offline_time, usec_to_time(b.start_service_time) start_service_time, b.status, usec_to_time(b.stop_time) stop_time, b.build_version 

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;

查看已经分配了的资源:

select t1.name resource_pool_name, t2.`name` unit_config_name, t2.max_cpu, t2.min_cpu, round(t2.max_memory/1024/1024/1024) max_mem_gb, round(t2.min_memory/1024/1024/1024) min_mem_gb, 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;

总的资源减去已分配的资源,剩下的就是还可以再进行分配的资源。

2 个赞

对,先看看第二个sql,然后把 sys_unit_config的min_cpu, min_memory值调整到跟max值一样


alter resource unit sys_unit_config min_cpu=xxx, min_memory='xxxG';


然后看第一个sql就知道准确的剩余cpu和内存了。



从楼主发的80G内存设置看,扣除默认的 30G的system_memory ,以及扣除 sys_unit_config的最小值和最大值差异,剩余内存估计48G不到,所以分配60G的内存会报资源不足。


system_memory默认值也可以调低10个G。

3 个赞

好的,谢谢。问题已解决。