调整 MetaDB 组件的资源规格只变更了 metadb docker 容器使用的 CPU/Memory 的大小,但是 metacluster 实际可以使用的资源受 cpu_count 和 memory_limit 这两个参数控制,而这两个参数的值没有自动修改,导致可使用的资源没有发生变化。
适用版本
OAT V4.1.2 BP1 之前的版本。
操作方法
修改 meta cluster 的集群参数
cpu_count和memory_limit。cpu_count= MetaDB 容器的 CPU 核数。memory_limit= MetaDB 容器的 memory - 3G。
方法一:黑屏修改。在 metadb 容器所在的服务器上,黑屏连接 root@sys 租户
$ mysql -h127.0.0.1 -uroot@sys -P2881 -pxxx -A oceanbase -c Welcome to the MariaDB monitor. Commands end with ; or \g. Your MySQL connection id is 3221xxxxxxx Server version: 5.7.25 OceanBase 2.2.77 (r116010032023022813-4f4fbb6de5d75b4db00ee05d44d56d8c1500c21c) (Built Feb 28 2023 13:48:43) Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MySQL [oceanbase]> show parameters like 'cpu_count'; +-------------+----------+---------------+----------+-----------+-----------+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+ | zone | svr_type | svr_ip | svr_port | name | data_type | value | info | section | scope | source | edit_level | +-------------+----------+---------------+----------+-----------+-----------+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+ | META_ZONE_1 | observer | xx.xx.xx.xx | 2882 | cpu_count | NULL | 16 | the number of CPU\'s in the system. If this parameter is set to zero, the number will be set according to sysconf; otherwise, this parameter is used. Range: [0,+∞) in integer | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE | +-------------+----------+---------------+----------+-----------+-----------+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+ 1 row in set (0.01 sec)MySQL [oceanbase]> show parameters like 'memory_limit'; +-------------+----------+---------------+----------+--------------+-----------+-------+-------------------------------------------------------------------------------------+----------+---------+---------+-------------------+ | zone | svr_type | svr_ip | svr_port | name | data_type | value | info | section | scope | source | edit_level | +-------------+----------+---------------+----------+--------------+-----------+-------+-------------------------------------------------------------------------------------+----------+---------+---------+-------------------+ | META_ZONE_1 | observer | xx.xx.xx.xx | 2882 | memory_limit | NULL | 56G | the size of the memory reserved for internal use(for testing purpose). Range: [0M,) | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE | +-------------+----------+---------------+----------+--------------+-----------+-------+-------------------------------------------------------------------------------------+----------+---------+---------+-------------------+ 1 row in set (0.00 sec)MySQL [oceanbase]> ALTER SYSTEM SET cpu_count = '20'; --->设置cpu_count Query OK, 0 rows affected (0.04 sec)MySQL [oceanbase]> ALTER SYSTEM SET memory_limit='60G'; --->设置memory_limit Query OK, 0 rows affected (0.04 sec) MySQL [oceanbase]>方法二:白屏修改
如果 meta cluster 已经接管到 OCP 中去了,可以直接在 OCP 白屏界面上调整相应的参数。
重启 meta cluster 使
cpu_count的修改生效。
更多信息
OAT V4.1.2 BP1 修复了这个问题,可以自动变更 Metadb 中的资源规格,并重启 Docker 来使修改生效。