In OceanBase Database, configuration items correspond to cluster parameters. These configuration items allow you to control the load balancing, compaction time, compaction mode, resource allocation, and module switches of an OceanBase cluster.
Effective modes
Configuration items generally take effect dynamically or upon OBServer restart. Most configuration items take effect dynamically without a need to restart the OBServer server.
Parameter levels
OceanBase provides cluster-level and tenant-level configuration items.
You can use the following method to query whether a configuration item is a cluster-level or tenant-level variable:
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)
If the value in the scope column is CLUSTER, the configuration item is a cluster-level variable. If the value in the scope column is TENANT, the configuration item is a tenant-level variable.
Management permissions
Management permissions for the configuration items are subject to the following rules:
A system tenant can view and set configuration items for all other tenants, including other system tenants.
A common tenant can view and configure the configuration items of only the current tenant.
After OBServer is started, if no configuration item is specified, the system uses the default values for the specified configuration items.
Comparison with system variables
| Property | System configuration items | System variables |
|---|---|---|
| Effective scope | Affects a cluster, zone, server, or tenant. | Affects a tenant globally or at the session level. |
| Effective modes | * Dynamically take effect: The value of edit_level is dynamic_effective. * Effective upon restart: The value of edit_level is static_effective. |
* A session-level variable takes effect only on the current session. * A global variable does not take effect on the current session and takes effect only on sessions established upon re-logon. |
| Modification | * You can execute SQL statements to modify a configuration item. Example: sql obclient> Alter SYSTEM SET schema_history_expire_time='1h' * You can set the startup parameters to modify a configuration item. Example: sql cd /home/admin && ./bin/observer -o "schema_history_expire_time='1h'" |
Modification can only be performed by using SQL statements. Example: * MySQL mode sql obclient> SET ob_query_timeout = 20000000; obclient> SET GLOBAL ob_query_timeout = 20000000; * Oracle mode sql obclient> SET ob_query_timeout = 20000000; obclient> ALTER SYSTEM SET ob_query_timeout = 20000000; |
| Persistence | Configuration items are persisted into internal tables and configuration files, and can be queried from the /home/admin/oceanbase/etc/observer.config.bin and /home/admin/oceanbase/etc/observer.config.bin.history files. |
Only variables at the global level are persisted, while those at the session level are not. |
| Life cycle | Long. A configuration item remains effective for the entire duration of a process. | Short. A variable takes effect only after the tenant schema is created. |
| Querying | You can query a configuration item by using the SHOW PARAMETERS statement. |
You can query a variable by using the SHOW [GLOBAL] VARIABLES statement. |