In OceanBase Database, you can set parameters to control the features of a cluster, such as load balancing, major compaction time, major compaction mode, resource allocation, and module switches.
You must specify the required parameters when the observer process starts for the first time. For other parameters, the default values are used if you do not specify them. After the process is started, the parameter values are persisted to the observer.config.bin file in the /home/admin/oceanbase/etc directory. You can run the strings observer.config.bin command to view the content in this file. When the process is started the next time, the system reads the parameter values from this file. If no modification is required, you do not need to specify any parameters.
Parameter levels
OceanBase Database provides cluster-level and tenant-level parameters.
Cluster-level parameters apply to all OBServer nodes in the cluster.
Tenant-level parameters apply to the OBServer node to which the current tenant belongs.
Parameters whose names start with an underscore (_), such as _ob_max_thread_num, are hidden parameters. Hidden parameters are used by developers only for troubleshooting or emergency O&M. This topic does not describe hidden parameters, nor does it involve any.
Different types of tenants have different privileges regarding viewing and modifying parameters, as follows:
| Tenant type | Parameters that can be viewed | Parameter settings |
|---|---|---|
| sys tenant | Cluster-level parameters and tenant-level parameters
NoteYou can specify the |
Cluster-level parameters and tenant-level parameters
NoteIn the sys tenant, you can specify the |
| User tenant | Cluster-level parameters, and tenant-level parameters of the current tenant | Tenant-level parameters of the current tenant |
The following table describes the data types of parameters in OceanBase Database.
| Data type | Description |
|---|---|
| BOOL | The Boolean type. Valid values: true and false. |
| CAPACITY | The unit of capacity. Valid values: b (bytes), k (kilobytes, KB), m (megabytes, MB), g (gigabytes, GB), t (terabytes, TB), and p (petabytes, PB). The unit is case-insensitive. Default value: m. |
| DOUBLE | The Double (double-precision floating-point) type. A value of this data type occupies a storage space of 64 bits, contains 16 valid digits, and is accurate to 15 digits after the decimal point. |
| INT | The Int64 type. A value of this data type can be a positive integer, negative integer, or 0. |
| MOMENT | The type that represents a moment in the hh:mm format, such as 02:00. Special value: disable, which indicates that no time is specified. This data type applies only to the major_freeze_duty_time parameter. |
| STRING | The string type. A value of this type is entered by users. |
| STRING_LIST | The type that represents a list of strings separated with semicolons (;). |
| TIME | The time type. The following time units are supported: us (microseconds), ms (milliseconds), s (seconds), m (minutes), h (hours), and d (days). If no suffix is added to a value of this data type, the unit s is used by default. The unit is case-insensitive. |
Effective mode of a parameter
Generally, parameters take effect dynamically or upon a restart of the OBServer node. Most parameters take effect dynamically without the need to restart the OBServer node.
View the level and effective mode of a parameter
To view the level and effective mode of a parameter, execute the following statement:
obclient [(none)]> 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 | 10.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 | 10.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 | 10.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 | 10.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 | 10.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
Take note of the following points:
The value in the
scopecolumn indicates the level of the parameter. The valueCLUSTERindicates a cluster-level parameter, and the valueTENANTindicates a tenant-level parameter.The value in the
edit_levelcolumn indicates the effective mode of the parameter. The valuedynamic_effectiveindicates that the parameter takes effect dynamically, and thestatic_effectivevalue indicates that the parameter takes effect upon a restart of the OBServer node. Most parameters take effect dynamically without the need to restart the OBServer node.
References
For more information about O&M operations related to cluster parameters, see the following topics: