【产品名称】oceanbasep社区版
【产品版本】obproxy-3.1.0-1.el7.x86_64.rpm
oceanbase-ce-3.1.0-2.el7.x86_64.rpm
oceanbase-ce-libs-3.1.0-2.el7.x86_64.rpm
【问题描述】参考《https://www.oceanbase.com/community/articles/1100213》部署后,创建资源池不成功。
使用了《单副本扩容到三副本》的方式,创建资源池不成功。
【产品名称】oceanbasep社区版
【产品版本】obproxy-3.1.0-1.el7.x86_64.rpm
oceanbase-ce-3.1.0-2.el7.x86_64.rpm
oceanbase-ce-libs-3.1.0-2.el7.x86_64.rpm
【问题描述】参考《https://www.oceanbase.com/community/articles/1100213》部署后,创建资源池不成功。
使用了《单副本扩容到三副本》的方式,创建资源池不成功。
MySQL [oceanbase]> SELECT svr_ip,svr_port, cpu_total, mem_total, disk_total, zone FROM __all_virtual_server_s tat ;
+----------------+----------+-----------+------------+-------------+-------+
| svr_ip | svr_port | cpu_total | mem_total | disk_total | zone |
+----------------+----------+-----------+------------+-------------+-------+
| 192.168.95.72 | 2882 | 14 | 4294967296 | 53687091200 | zone1 |
| 192.168.95.74 | 2882 | 14 | 4294967296 | 53687091200 | zone2 |
| 192.168.95.216 | 2882 | 14 | 4294967296 | 53687091200 | zone3 |
+----------------+----------+-----------+------------+-------------+-------+
3 rows in set (0.01 sec)
首先,把 sys_unit的min_memory和min_cpu更新到跟 max_memory和max_cpu一样的值
alter resource unit sys_unit_config max_cpu=5,min_cpu=5,max_memory='12G',min_memory='12G';
然后查看节点剩余资源。
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
;
可以再看看那篇文章中步骤。每一步都有意义。