OB-系统变量和参数

系统参数和变量

参数与变量的区别

系统参数

通常,在集群级别设置的配置相关变量称为参数(parameters)。参数的改变会记录到__all_sys_parameter和参数文件observer.config.bin(二进制格式文件)中,每个节点都保存一份。

参数文件路径

OceanBae集群参数修改后都会立即持久化到本地参数文件里,可以通过参数config_additional_dir 指定本地参数文件路径

show parameters like '%config_additional_dir%';

每次修改后,参数文件都会保留上一个版本在文件observer.config.bin.history里,以避免参数修改错误导致集群启动失败。

隐含参数

__开头的参数称为隐含参数

系统变量

通常,在租户级别设置的配置相关变量称为变量(variables)。变量的修改会记录到__all_virtual_sys_variable,如:set global autocommit=off;

查看系统变量和参数

查看参数

数据字典
select * from __all_sys_parameter 
-- where name like '%_ob_enable_prepared_statement%';

show parameters;
show parameters like '%limit%';
show parameters
where name in (
'memory_limit_percentage',
'memory_limit',
'enable_sql_audit',
'enable_rebalance'
);
OS层查看
strings observer.config.bin|grep -E "minor_freeze_times|freeze_trigger_percentage"

查看变量

数据字典
select * from __all_virtual_sys_variable
-- where name like '%commit%';

show global variables like '%timeout%';

show global variables where variable_name in ('ob_query_timeout','ob_trx_timeout','ob_trx_idle_timeout');

修改系统变量和参数

参数

alter system set minor_freeze_times=100;
-- 修改指定节点
alter system set freeze_trigger_percentage=75 server='192.168.10.132:2882';    

变量

租户变量ob_tcp_invited_nodes可以针对访问来源设置白名单。白名单格式可以是'%',表示允许所有的来源。也可以是一个或多个具体的IP或者子网。

set global ob_tcp_invited_nodes='127.0.0.1,192.168.0.0/16';
原文地址:https://www.cnblogs.com/binliubiao/p/15258991.html