OceanBase 数据库的配置项对应 OceanBase 数据库的集群参数,通过配置项可以控制集群的负载均衡、合并时间、合并方式、资源分配和模块开关等。
生效方式
配置项一般分为动态生效和重启生效两种方式,大部分配置项为动态生效方式,即不需要重启 OBServer 即可生效。
参数级别
OceanBase 数据库的配置项分为集群级别和租户级别。
查询某个配置项为集群级别还是租户级别的方法如下:
obclient> SHOW PARAMETERS LIKE 'max_syslog_file_count';
+-------+----------+----------------+----------+-----------------------+-----------+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
| zone | svr_type | svr_ip | svr_port | name | data_type | value | info
| section | scope | source | edit_level |
+-------+----------+----------------+----------+-----------------------+-----------+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
| zone2 | observer |
xx.xx.xx.xx
| 2882 | max_syslog_file_count | NULL | 0 | specifies the maximum number of the log files that can co-exist before the log file recycling kicks in. Each log file can occupy at most 256MB disk space. When this value is set to 0, no log file will be removed. Range: [0, +∞) in integer | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone2 | observer | xx.xx.xx.xx | 2882 | max_syslog_file_count | NULL | 0 | specifies the maximum number of the log files that can co-exist before the log file recycling kicks in. Each log file can occupy at most 256MB disk space. When this value is set to 0, no log file will be removed. Range: [0, +∞) in integer | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone3 | observer | xx.xx.xx.xx | 2882 | max_syslog_file_count | NULL | 0 | specifies the maximum number of the log files that can co-exist before the log file recycling kicks in. Each log file can occupy at most 256MB disk space. When this value is set to 0, no log file will be removed. Range: [0, +∞) in integer | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone1 | observer | xx.xx.xx.xx | 2882 | max_syslog_file_count | NULL | 0 | specifies the maximum number of the log files that can co-exist before the log file recycling kicks in. Each log file can occupy at most 256MB disk space. When this value is set to 0, no log file will be removed. Range: [0, +∞) in integer | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
| zone1 | observer | xx.xx.xx.xx | 2882 | max_syslog_file_count | NULL | 0 | specifies the maximum number of the log files that can co-exist before the log file recycling kicks in. Each log file can occupy at most 256MB disk space. When this value is set to 0, no log file will be removed. Range: [0, +∞) in integer | OBSERVER | CLUSTER | DEFAULT | DYNAMIC_EFFECTIVE |
+-------+----------+----------------+----------+-----------------------+-----------+-------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------+---------+-------------------+
5 rows in set (0.02 sec)
其中,scope
列对应的值为 CLUSTER
表示该配置项为集群级别;如果 scope
列对应的值为 TENANT
,则表示该配置项为租户级别。
管理权限
配置项的管理遵循以下管理规则:
系统租户可以查看和设置所有其他租户(包括系统租户)的配置项。
普通租户只能查看和设置本租户的配置项。
当 OBServer 启动后,如果未指定配置项,则系统会使用指定配置项的默认值。更多配置项的查看和设置操作请参见 集群参数管理 章节。
与系统变量对比
对比项 | 系统配置项 | 系统变量 |
---|---|---|
生效范围 | 分为集群、Zone、机器和租户。 | 分为租户的 Global 或 Session 级别。 |
生效方式 |
|
|
修改方式 |
| 仅支持通过 SQL 语句修改,示例如下:
|
持久化 | 持久化到内部表与配置文件,可以在 | 仅 GLOBAL 级别的变量会持久化,SESSION 级别的变量不会进行持久化。 |
生命周期 | 长,从进程启动到退出。 | 短,需要租户的 Schema 创建成功以后才生效。 |
查询方式 | 可以使用 | 可以使用 |