创建租户4013内存不足

【 使用环境 】生产环境 or 测试环境
【 OB or 其他组件 】
【 使用版本 】
【问题描述】清晰明确描述问题
【复现路径】问题出现前后相关操作
【问题现象及影响】

【附件】
测试环境,手动部署的三副本集群
启动命令:/home/admin/oceanbase/bin/observer -I 10.228.162.109 -P 2882 -p 2881 -z zone1 -d /vdb/oceanbase/store/obtest -r ‘10.228.162.109:2882:2881;10.228.162.143:2882:2881;10.228.131.29:2882:2881’ -c 10001 -n obtest -o “memory_limit=10G,cache_wash_threshold=1G,system_memory=1G,memory_chunk_cache_size=128M,cpu_count=2,net_thread_count=4,datafile_size=20G,log_disk_size=30G,stack_size=1536K,config_additional_dir=/vdb/oceanbase/data/1/obtest/etc3;/vdb/oceanbase/data/log1/obtest/etc2”
修改了最小内存参数:alter system __min_full_resource_pool_memory=1073741824;
创建租户命令:
create resource unit u1 max_cpu 1,memory_size ‘1G’,max_iops 1024,log_disk_size=‘10G’;
create resource pool p1 unit ‘u1’,unit_num 1,ZONE_LIST=(‘zone1’,‘zone2’,‘zone3’);
CREATE TENANT IF NOT EXISTS mysqltest CHARSET=‘utf8mb4’, ZONE_LIST=(‘zone1’,‘zone2’,‘zone3’), PRIMARY_ZONE=‘zone1;zone2,zone3’, RESOURCE_POOL_LIST=(‘p1’);
资源:


报错:

进程启动参数里 cpu_count=2 这个太小了。改为 cpu_count=16 。 可以重新带参数启动节点。不用管实际虚拟机有没有16个cpu。ob不检查这个。
然后再试试。

查一下下面两个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;

cpu_count改成8和16都不行,
原来的结果


该参数后的结果

现在的资源

版本是OceanBase_CE 4.2.0.0

这个结果截图没有发。

原来的


现在的

sys 租户里 发起一次合并,释放内存。

alter system major freeze;

另外,sys租户和业务租户的 cpu 不要太少,太少干活很慢。

alter resource unit sys_unit_config max_cpu=4,min_cpu=4;
alter resource unit u1 max_cpu=4,min_cpu=4;