ITPub博客

首页 > 数据库 > 国内数据库 > OB中动态修改OBServer 的 CPU 上限步骤

OB中动态修改OBServer 的 CPU 上限步骤

原创 国内数据库 作者:董小姐yyds 时间:2025-09-24 14:29:24 0 删除 编辑

以 2C 的机器为例,不同配置下机器上的 OBServer 的 CPU 上限如下所示:

--连接集群
obclient -h192.168.40.110 -P2881 -uroot@sys -p'61608Hhd820.' -Doceanbase -A
--修改前查看参数: scope 列对应的值为 CLUSTER 表示该配置项为集群级别;如果 scope 列对应的值为 TENANT,则表示该配置项为租户级别。
obclient(root@sys)[oceanbase]> show parameters like 'cpu_count';
+-------+----------+----------------+----------+-----------+-----------+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+---------------+-----------+
| zone  | svr_type | svr_ip         | svr_port | name      | data_type | value | info                                                                                                                                                                             | section  | scope   | source  | edit_level        | default_value | isdefault |
+-------+----------+----------------+----------+-----------+-----------+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+---------------+-----------+
| zone1 | observer | 192.168.40.110 |     2882 | cpu_count | INT       | 8     | 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 | 0             |         0 |
+-------+----------+----------------+----------+-----------+-----------+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+---------------+-----------+
1 row in set (0.019 sec)
--更改OBServer 自动检测服务器的 CPU 核数 
ALTER SYSTEM SET cpu_count=0;
SELECT SVR_IP,CPU_CAPACITY FROM GV$OB_SERVERS WHERE SVR_IP='192.168.40.110'; 返回2
--更改OBServer  自定义CPU 核数 为1
ALTER SYSTEM SET cpu_count=1;
SELECT SVR_IP,CPU_CAPACITY FROM GV$OB_SERVERS WHERE SVR_IP='192.168.40.110'; 返回1


参数说明:

  • cpu_count 默认为 0 时,OBServer 自动检测服务器的 CPU 核数,实际的 CPU_COUNT 等于 CPU 核数。
  • 可以在 GV$OB_SERVERS 内部表的 CPU_CAPACITY 字段查看实际生效的值。


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69963491/viewspace-3096430/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
拥有Oracle 11g OCM,KCA,KCP,DCA,PGCA,PGCE等证书,墨天轮技术专家,墨天轮2024年度优秀作者,青学会成员。擅长主流Oracle、MySQL、PG安装部署、故障定位处理、性能优化,金仓、达梦、openGauss系等各种商用和开源国产数据库。

注册时间:2020-02-22

  • 博文量
    33
  • 访问量
    43735