Cluster parameters

2023-08-01 06:02:28  Updated

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 starts, 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 starts 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 will not go into details on hidden parameters. The following parameters also do not involve any hidden parameters.

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

Note

You can specify the TENANT keyword in the SHOW PARAMETERS statement to view the parameter settings of a specified tenant.

Cluster-level parameters and tenant-level parameters

Note

In the sys tenant, you can specify the TENANT keyword to modify the parameters of all tenants or a specific tenant.

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 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 Strings. The user-specified string value.
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
  • The value in the scope column indicates the level of the parameter. The value CLUSTER indicates a cluster-level parameter, and the value TENANT indicates a tenant-level parameter.

  • The value in the edit_level column indicates the effective mode of the parameter. The value dynamic_effective indicates that the parameter takes effect dynamically, and the static_effective value 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.

More information

For more information about O&M operations related to cluster parameters, visit the following links:

Contact Us