暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

万里数据库GreatDB系统变量&详细说明

原创 Dbb 2024-05-16
613

GreatDB新增加的变量及状态属性分为三类,分别为:

  • Server层新增的系统变量
变量名称
gdb_add_network_cost
gdb_backup_dir
gdb_binlog_server
gdb_binlog_server_slave_mode
gdb_binlog_server_timediff
gdb_ddl_id
gdb_ddl_sum
gdb_direct_processing
gdb_encrypt_key_path
gdb_parallel_load
gdb_parallel_load_chunk_size
gdb_parallel_load_workers
gdb_split_outfile
gdb_split_outfile_rotate_size
gdb_split_outfile_wait_transport
gdb_sqld_version
gdb_strict_create_table
gdb_sequence_force_frontend
gdb_zone_name
server_instance_type
ora_emptystring_equal_null
shrink_sql_mode
enable_recycle_bin
show_dtid_enable_info
track_mvcc_dtm_footprint
gdb_cluster_ddl_metalock
gdb_direct_pushdown_time_funcs
gdb_enable_xplan
gdb_xplan_enable_const_pushdown
gdb_xplan_enable_multi_shards
  • GreatDB存储引擎新增的系统变量
变量名称
greatdb_backend_table_engine
greatdb_change_primary_datanode_delay_threshold
greatdb_commit_hash
greatdb_connection_keepalive_user_timeout
greatdb_ddl_lock_backend_wait_timeout
greatdb_debug_method
greatdb_enable_force_init_cluster (internal_use)
greatdb_enable_instant_add_column
greatdb_enable_xa
greatdb_encrypt_key_file
greatdb_implicit_rollback_error_trx
greatdb_is_restore_binlog_applier
greatdb_init_connections
greatdb_max_connections
greatdb_migrate_table_parallel_num
greatdb_new_datanode_clone_threshold
greatdb_new_sqlnode_clone_threshold
greatdb_node_time_diff_limit
greatdb_optimize_direct_delete
greatdb_optimize_multi_recs_update
greatdb_parallel_read_threads
greatdb_physical_migrate_table
greatdb_physical_migrate_table_mode
greatdb_result_cache_batch_cnt
greatdb_result_cache_size
greatdb_sync_autoincrement_interval
greatdb_table_cache_size
greatdb_upgrade_cluster
greatdb_version
greatdb_connect_timeout
greatdb_use_normal_transaction
greatdb_data_file_async_purge
greatdb_enable_dtm
greatdb_dtm_server_candidate
greatdb_dtm_server_port
greatdb_dtm_server_address
greatdb_dtm_trx_timeout
greatdb_dtm_client_con_count
greatdb_dtm_client_con_interval
greatdb_dtm_client_connect_tries
greatdb_dtm_handshake_timeout
greatdb_dtm_server_recv_concurrency
greatdb_dtm_server_send_concurrency
greatdb_dtm_client_gen_view_concurrency
greatdb_dtm_server_combine_snap
greatdb_dtm_client_incr_snap
greatdb_dtm_log_level
greatdb_dtm_log_file
greatdb_dtm_server_reply_threads
greatdb_enable_dml_acquire_dtm_readview
greatdb_enable_purge_dtm_xa_log
greatdb_print_dtm_debug_info
innodb_dtm_disable
greatdb_dtm_server_wait_sync_time
greatdb_dtm_trx_available
greatdb_wait_non_running_xa_trx_before_dtm_start
greatdb_dtm_async_commit_level
innodb_greatdb_non_dtm_upgrade_to_dtm
greatdb_dtm_readview_wakeup_count
greatdb_dtm_readview_read_count
greatdb_dtm_trx_async_commit
greatdb_dtm_server_time_persist_timeout
greatdb_dtm_server_sqlnode_address
greatdb_output_dtm_status
greatdb_dtm_trx_perf_track_frequency
greatdb_dtm_client_id_generate_method
greatdb_deadlock_detection_period
greatdb_enable_deadlock_detection
greatdb_deadlock_detection_record_in_log
greatdb_inject_sqlnode_info
greatdb_records_in_range_from_dn
greatdb_records_in_range_max_partitions
greatdb_rnd_pos_probe
  • show status新增的归属greatdb存储引擎的属性

执行show status;

变量名称
greatdb_cluster_initialized
greatdb_cluster_name
greatdb_cluster_user
greatdb_clone_protect_mode (internal use)
greatdb_committing_trxs
greatdb_delay_commit_requests (internal use)
greatdb_read_only_mode

目前所有Greatdb新增的变量的SET_VAR Hint Applies属性都为false。

  • sql_mode变量

    sql_mode新增支持"Oracle"模式,在Oracle模式下,Greatdb cluster集群兼容Oracle语法。

    该变量是string类型,通过set session/global sql_mode = "Oracle";设置。

  • 其它系统变量

变量名称
group_replication_zone_id
group_replication_zone_id_sync_mode

系统变量详细说明

gdb_add_network_cost

PropertyValue
Command-Line Formatgdb-add-network-cost[={OFF|ON}]
System Variablegdb_add_network_cost
ScopeGlobal, Session
DynamicYes
Typebool
Default valuefalse
Version5.0.8

该参数影响优化器生成执行计划。当为true时,优化器将考虑datanode和sqlnode之间的网络开销。

gdb_backup_dir

PropertyValue
Command-Line Formatgdb-backup-dir=#
System Variablegdb_backup_dir
ScopeGlobal
DynamicNo_persist, Read_only
TypeString
Default valueNULL
Version5.0.8

该参数表示执行备份时,相关备份文件及增量binlog的在备份节点上的存储路径。

  1. 该值可以为空,但集群的备份节点需要配置非空参数
  2. 该值为一个合法的路径,否则数据库实例可能无法启动
  3. 数据库实例需要有该路径的访问权限,否则数据库实例可能无法启动

gdb_binlog_server

PropertyValue
Command-Line Formatgdb_binlog_server[={OFF|ON}]
System Variablegdb_binlog_server
ScopeGlobal
DynamicNo_persist, Read_only
Typebool
Default valuefalse
Version5.0.8

该参数表示是否将该节点作为greatdb cluster binlog server节点。

gdb_binlog_server_slave_mode

PropertyValue
Command-Line Formatgdb_binlog_server_slave_mode[={OFF|ON}]
System Variablegdb_binlog_server_slave_mode
ScopeSession
DynamicYes
Typebool
Default valuefalse
Version5.0.8

该参数设置为ON,并且gdb_binlog_server也设置为ON,将会按照binlog_server的方式应用binlog中的事件。

gdb_binlog_server_timediff

PropertyValue
Command-Line Formatnot support command line
System Variablegdb_binlog_server_timediff
ScopeGlobal
DynamicYes
Typeunsigned long long
Default value0
Version6.0.1-GA-2

该参数用于配置binlog-server同步数据时,sqlnode、各个shard之间同步协调应用binlog数据的最大允许的时间差值。

默认值为0,表示binlog-server同步数据时,sqlnode、各个shard之间应用binlog数据时,不进行进度协调的同步。

参数不为0时,则最小配置为300,单位为秒。此时,sqlnode、各个shard之间应用binlog数据时,允许的最大应用binlog的时间差值为gdb_binlog_server_timediff。如果最慢的节点binlog处理的当前时间为10:00:00,而最快的节点binlog处理的当前时间为10:10:00,此时,最快的节点会暂停应用,直到和最慢的节点的时间差小于gdb_binlog_server_timediff。

gdb_ddl_id

PropertyValue
Command-Line Formatnot support command line
System Variablegdb_ddl_id
ScopeSession
DynamicYes
Typeunsigned long long
Default value0
Version5.0.8

该参数表示greatdb cluster中每条DDL语句的id,并记录在binlog中。

gdb_ddl_sum

PropertyValue
Command-Line Formatnot support command line
System Variablegdb_ddl_sum
ScopeSession
DynamicYes
Typeunsigned int
Default value0
Version5.0.8

该参数表示greatdb cluster中DDL语句的总个数,并记录在binlog中。

gdb_direct_processing

PropertyValue
Command-Line Formatgdb-direct-processing[={OFF|ON}]
System Variablegdb_direct_processing
ScopeGlobal, Session
DynamicYes
Typebool
Default valuefalse
Version5.0.8

该参数影响当前session是否启用direct processing优化。

gdb_encrypt_key_path

PropertyValue
Command-Line Formatgdb_encrypt_key_path=#
System Variablegdb_encrypt_key_path
ScopeGlobal
Dynamicyes
TypeString
Default valueNULL
Version6.0.0

该参数仅在备份节点上有效,表示执行备份时,是否开启加密备份,如果该参数指定为存放密钥文件的路径,则备份数据是加密的。

gdb_parallel_load

PropertyValue
Command-Line Formatnot support command line
System Variablegdb_parallel_load
ScopeSession_only
DynamicYes
Typebool
Default valuefalse
Version5.0.8

true表示开启并行导入功能。当执行load data infile 'infile' into table时,是否开启并行导入;

gdb_parallel_load_chunk_size

PropertyValue
Command-Line Formatnot support command line
System Variablegdb_parallel_load_chunk_size
ScopeSession
DynamicYes
Typeinterger
Default value1 MB
Min value64 KB
Max value128 MB
Version5.0.8

该参数表示当执行load data infile 'infile' into table时,开启并行导入时,每次导入文件块的大小;

gdb_parallel_load_workers

PropertyValue
Command-Line Formatnot support command line
System Variablegdb_parallel_load_workers
ScopeSession
DynamicYes
Typeinterger
Default value8
Min value1
Max value24
Version5.0.8

该参数表示当执行load data infile 'infile' into table时,开启并行导入时,并行执行者的个数,默认为8;

gdb_split_outfile

PropertyValue
Command-Line Formatnot support command line
System Variablegdb_splice_outfile
ScopeSession_only
DynamicYes
Typebool
Default valuefalse
Version5.0.8

当session开启时,select * into outfile 'outfile_path' from table会按照gdb_split_outfile_rotate_size的大小分割成多个文件,精确到行。导出的文件包含一个索引文件,名称为outfile_path.index,按行记录所有数据文件名。数据文件名的格式为outfile_path.xxxxxx,其中xxxxxx为序号。

该参数目前主要供内部使用。如果有分割outfile文件的需求,也可启用该参数。

gdb_split_outfile_rotate_size

PropertyValue
Command-Line Formatnot support command line
System Variablegdb_splice_outfile_rotate_size
ScopeGlobal, Session
DynamicYes
Typeinterger
Default value1 MB
Min value64 bytes
max value128 MB
Version5.0.8

gdb_split_outfile参数为true时,该参数有意义。执行select * into outfile 'outfile_path' from table时,当前文件的大小达到该值时,关闭当前文件并向一个新文件中写入。

gdb_split_outfile_wait_transport

PropertyValue
Command-Line Formatnot support command line
System Variablegdb_split_outfile_wait_transport
ScopeSession_only
DynamicYes
Typebool
Default valuefalse
Version5.0.8

该参数为true时,表当执行select ... into outfile时,将当前的文件拆分为多个小文件发送到不同的位置避免文件积压。默认为false。

gdb_sqld_version

PropertyValue
Command-Line Formatnot support command line
System Variablegdb_sqld_version
ScopeGlobal
DynamicConst
TypeString
Default valueGreatDB server层版本号
Version5.0.8

该参数GreatDB server层的版本号(含datanode)。如5.0.5.1。与之对应的参数有greatdb_version,表示GreatDB存储引擎层的版本号。

gdb_sequence_force_frontend

PropertyValue
Command-Line Formatgdb-sequence-force-frontend[={OFF|ON}]
System Variablegdb_sequence_force_frontend
ScopeGlobal
DynamicYes
Typebool
Default valueOFF
Version6.0.2

当参数为ON时,创建序列的backend选项会被忽略,并自动替换为frontend。受此影响,序列当前值持久化在当前节点、不再持久化到后端datanode,不再依赖greatdb engine。用于binlog server同步数据到单机实例。

gdb_strict_create_table

PropertyValue
Command-Line Formatgdb-strict-create-table[={OFF|ON}]
System Variablegdb_strict_create_table
ScopeGlobal, Session
DynamicYes
Typebool
Default valueON
Version5.0.8

当参数为ON(默认)时,当前session只能创建GreatDB存储引擎的表。如果用户需要创建其它引擎,如innodb表,可以将该参数设置为OFF。

gdb_zone_name

PropertyValue
Command-Line Formatgdb-zone-name=#
System Variablegdb_zone_name
ScopeGlobal
DynamicGlobal
Typestring
Default valueDEFAULT
Version5.0.8

gdb_cluster_ddl_metalock

PropertyValue
Command-Line Formatgdb-cluster-ddl-metalock[={OFF|ON}]
System Variablegdb_cluster_ddl_metalock
ScopeGlobal, Session
DynamicYes
Typebool
Default valuetrue
Version5.0.8

该参数表示在mgr环境中开启ddl的全局MDL锁。默认值为ON,表示开启该功能。

gdb_direct_pushdown_time_funcs

PropertyValue
Command-Line Formatgdb-direct-pushdown-time-funcs[={OFF|ON}]
System Variablegdb_direct_pushdown_time_funcs
ScopeGlobal, Session
DynamicYes
Typebool
Default valuefalse
Version5.0.8

该参数是关于语句下推的,对于非partition表,下推sysdate、now函数到DATANODE,默认是关闭的。默认为false,表示不下推。

gdb_enable_xplan

PropertyValue
Command-Line Formatgdb-enable-xplan[={OFF|ON}]
System Variablegdb_enable_xplan
ScopeGlobal, Session
DynamicYes
Typebool
Default valuefalse
Version5.0.8

该参数是xplan总开关,只开启该开关,非分区表可以使用xplan,默认为OFF。

gdb_xplan_enable_const_pushdown

PropertyValue
Command-Line Formatgdb-xplan-enable-const-pushdown[={OFF|ON}]
System Variablegdb_xplan_enable_const_pushdown
ScopeGlobal, Session
DynamicYes
Typebool
Default valuefalse
Version6.0.0

该参数表示Xplan在开启的情况下,是否支持唯一索引列的等值查询的const table下推,默认为OFF。

gdb_xplan_enable_multi_shards

PropertyValue
Command-Line Formatgdb-xplan-enable-multi-shards[={OFF|ON}]
System Variablegdb_xplan_enable_multi_shards
ScopeGlobal, Session
DynamicYes
Typebool
Default valuefalse
Version5.0.8

该参数表示在gdb_enable_xplan开关开启的情况下, 打开该开关,涉及分区表的计划可使用xplan,默认为OFF。

server_instance_type

PropertyValue
Command-Line Formatserver-instance-type=instance_type
System Variableserver_instance_type
ScopeGlobal
DynamicRead_only
TypeEnumeration
Default valueNORMAL_NODE
Valid valueNORMAL_NODE,
GREATDB_SQLNODE,
GREATDB_DATANODE,
GREATDB_BACKUP_NODE
Version5.0.8

标识当前数据库实例的类型

ora_emptystring_equal_null

PropertyValue
Command-Line Formatora_emptystring_equal_null={OFF|ON}
System Variableora_emptystring_equal_null
ScopeGlobal, Session
DynamicYes
Typebool
Default valueOFF
Version5.0.8

标识当前数据比较、统计等操作时空串''与NULL是否等价

shrink_sql_mode

PropertyValue
Command-Line Format--shrink_sql_mode=name
System Variableshrink_sql_mode
ScopeGlobal, Session
DynamicYES
TypeSET
Default value0
Valid valueALLOW_INVALID_DATES,</br>ANSI_QUOTES,</br>ERROR_FOR_DIVISION_BY_ZERO,</br>HIGH_NOT_PRECEDENCE,</br>IGNORE_SPACE,</br>NO_AUTO_VALUE_ON_ZERO,</br>NO_BACKSLASH_ESCAPES,</br>NO_DIR_IN_CREATE,</br>NO_ENGINE_SUBSTITUTION,</br>NO_UNSIGNED_SUBTRACTION,</br>NO_ZERO_DATE,</br>NO_ZERO_IN_DATE,</br>ONLY_FULL_GROUP_BY,</br>PAD_CHAR_TO_FULL_LENGTH,</br>PIPES_AS_CONCAT,</br>REAL_AS_FLOAT,</br>STRICT_ALL_TABLES,</br>STRICT_TRANS_TABLES,</br>TIME_TRUNCATE_FRACTIONA
Version5.0.8

在当前设置的sql_mode 完整的组合为基础上,进行移除指定的sql_mode, 可以同时移除多个mode

 例如:
   set sql_mode=oracle;
   set shrink_sql_mode='PIPES_AS_CONCAT,ERROR_FOR_DIVISION_BY_ZERO';
   则可以移除 oracle_mode 下使用 || 作为concat和 允许除与0

enable_recycle_bin

PropertyValue
Command-Line Formatnot support command line
System Variableenable_recycle_bin
ScopeGlobal
DynamicConst
Typebool
Default valueOFF
Version5.0.8

该变量表示是否开启回收站功能,true表示开启回收站功能。默认是false,关闭回收站功能的。

show_dtid_enable_info

PropertyValue
Command-Line Formatshow_dtid_enable_info=dtid_enable_info_level
System Variableshow_dtid_enable_info
ScopeGlobal, Session
DynamicYES
TypeEnumeration
Default valueENABLE_DTID_INFO_OFF
Valid valueDTID_INFO_OFF,
ENABLE_DTID_INFO_OFF,
ENABLE_DTID_INFO_ON
Version6.0.3

参数表示show create table是否展示enable_dtid信息:show_dtid_enable_info=DTID_INFO_OFF时,则不显示;show_dtid_enable_info=ENABLE_DTID_INFO_OFF时,对于enable_dtid=OFF则不显示,只显示enable_dtid=ON;show_dtid_enable_info=ENABLE_DTID_INFO_ON时,对于enable_dtid=OFF和enable_dtid=ON都显示。

track_mvcc_dtm_footprint

PropertyValue
Command-Line Formattrack_mvcc_dtm_footprint=#
System Variabletrack_mvcc_dtm_footprint
ScopeSession
DynamicYES
TypeUnsigned long
Default value0
Min value0
max value16
Version6.0.2

是否将可见性判断信息输入到error-log中, 0:不输出,> 0:输出。详细说明见集群手册Show Dtm Status说明章节。

greatdb_backend_table_engine

PropertyValue
Command-Line Formatgreatdb-backend-table-engine=backend_engine_type
System Variablegreatdb_backend_table_engine
ScopeGlobal, Session
DynamicYes
TypeString
Default valueInnoDB
Valid valueInnoDB,
RocksDB
Version5.0.8

该值指定Greatdb在后端创建表时,后端表的存储引擎类型。目前只用InnoDB。

greatdb_change_primary_datanode_delay_threshold

PropertyValue
Command-Line Formatgreatdb_change_primary_datanode_delay_threshold=#num
System Variablegreatdb_change_primary_datanode_delay_threshold
ScopeGlobal, Session
DynamicYes
TypeInterger
Default value1000
Min value1
Max value1000000
Version5.0.8

执行在线切主命令时call mysql.greatdb_change_shard_primary_node('shard_name', 'node_name')命令时,如果节点延迟太大时,切主命令可能执行较长时间,导致shard无法读写,为了防止上述问题,可以配置greatdb_change_primary_datanode_delay_threshold参数,指定允许的最大延迟事务gtid数,如果延迟超过该值,则拒绝用于切主请求。

greatdb_commit_hash

PropertyValue
Command-Line Formatnot support command line
System Variablegreatdb_commit_hash
ScopeGlobal
DynamicConst
TypeString
Default valueGreatDB当前版本对应的commit hash
Version5.0.8

该值表示GreatDB二进制程序对应的代码commit hash值

greatdb_connection_keepalive_user_timeout

PropertyValue
Command-Line Formatgreatdb-connection-keepalive-user-timeout=milliseconds
System Variablegreatdb_connection_keepalive_user_timeout
ScopeGlobal
DynamicYes
TypeInterger
Min5000
Max864000000
Default value30000
Version6.0.1

该值表示sqlnode到datanode连接池中连接的tcp keep alive user timeout参数值。

greatdb_ddl_lock_backend_wait_timeout

PropertyValue
Command-Line Formatnot support command line
System Variablegreatdb_ddl_lock_backend_wait_timeout
ScopeGlobal, Session
DynamicConst
TypeInterger
Min1
Max86400 (one day)
Default value600
Version

用于DDL和迁移任务。在迁移,alter-table等后台任务中,需要进行锁表操作,如LOCK TABLE等,引入该参数是为了控制锁表等待超时时间。

对于这些后台任务,lock table超时时间,不受后端数据节点本身的全局lock-wait-timeout控制。执行任务的sqlnode节点,会将greatdb_ddl_lock_backend_wait_timeout作为参数值,传递给后端task任务,后端任务在锁表之前,会重置session的lock-wait-timeout的值。

greatdb_debug_method

PropertyValue
Command-Line Formatgreatdb-debug-method=debug_method
System Variablegreatdb_debug_method
ScopeSession
DynamicYes
TypeString
Default value
Valid valuecmd_service,
task_alter_table
Version5.0.8

该参数表示触发的debug模式有cmd_service,task_alter_table。

greatdb_enable_force_init_cluster

PropertyValue
Command-Line Formatgreatdb-enable-force-init-cluster[={OFF|ON}]
System Variablegreatdb_enable_force_init_cluster
ScopeGlobal
DynamicRead_only
Typebool
Default valuefalse
Version5.0.8

在有脏数据的情况下强行初始化集群(调用init_cluster)接口

greatdb_enable_instant_add_column

PropertyValue
Command-Line Formatgreatdb-enable-instant-add-column[={OFF|ON}]
System Variablegreatdb_enable_instant_add_column
ScopeGlobal, Session
DynamicYes
Typebool
Default valuefalse
Version6.0.0-RC-1

Alter table添加列时,是否启用instant add column快速加列。

greatdb_enable_xa

PropertyValue
Command-Line Formatgreatdb-enable-xa[={OFF|ON}]
System Variablegreatdb_enable_xa
ScopeGlobal
DynamicRead_only
Typebool
Default valuefalsegreatdb-backend-table-engine
Version5.0.8

是否启用xa事务

greatdb_encrypt_key_file

PropertyValue
Command-Line Formatnot support command line argure
System Variablegreatdb_encrypt_key_file
ScopeGlobal
DynamicRead_only, No_persist
TypeString
Default valueNULL
Version5.0.8

集群各节点间连接口令的加密key所在的文件。

greatdb_implicit_rollback_error_trx

PropertyValue
Command-Line Formatgreatdb_implicit_rollback_error_trx[={OFF|ON}]
System Variablegreatdb_encrypt_key_file
ScopeGlobal
DynamicYes
Typebool
Default valueON
Version5.0.8

由于greatdb中数据分布部署,用户层面一条SQL语句,可能同时修改多个节点的数据,此时可能出现部分执行成功,部分执行失败的场景。此时,需要回滚整个事务。该参数开启时,执行语句出现错误时,会隐式回滚整个事务,此时,执行下一条语句时,会开启一个新的事务。如果关闭该参数,则需要用户显示执行ROLLBACK语句,回滚整个事务,否则无法执行任何语句。需要注意的是,不管该参数开启还是关闭,和原生MySQL的行为均不一样。对比如下:

原生 MySQLgreatdb开启隐式提交greatdb关闭隐式提交
BEGINBEGINBEGIN
INSERT (1)INSERT (1)INSERT (1)
INSERT (2)
error
INSERT (2)
error
INSERT (2)
error
INSERT (3)INSERT (3)INSERT (3)
error
COMMITCOMMITROLLBACK
SELECT * FROM t1
1, 3
SELECT * FROM t1
3
SELECT * FROM t1
empty set

greatdb_is_restore_binlog_applier

PropertyValue
Command-Line Formatgreatdb_is_restore_binlog_applier[={OFF|ON}]
System Variablegreatdb_is_restore_binlog_applier
ScopeSession
DynamicYes
Typebool
Default valuefalse
Version5.0.8

该参数表示恢复一个sqlnode时,是否重放binlog。默认为false。

greatdb_init_connections

PropertyValue
Command-Line Formatgreatdb-init-connections=connections
System Variablegreatdb_init_connections
ScopeGlobal
DynamicRead_only
Typeunsigned int
Default value100
Min value10
Max value1024
Version5.0.8

该参数表示每个SQLNode到每个DataNode的默认连接数,即初始化连接池中的连接个数。取值范围是[10, 1024],默认是100。

greatdb_max_connections

PropertyValue
Command-Line Formatgreatdb-max-connections=conn_num
System Variablegreatdb_max_connections
ScopeGlobal
DynamicRead_only
TypeInterger
Default value1024
Min value100
Max value65536
Version5.0.8

sqlnode到datanode连接池的最大连接数

greatdb_migrate_table_parallel_num

PropertyValue
Command-Line Formatnot support command line argument
System Variablegreatdb_migrate_table_parallel_num
ScopeGlobal
DynamicRead_only
TypeInterger
Default value3
Min value1
Max value20
Version5.0.8

表/集群迁移时,单个shard中最大并发子任务数。如果是基于clone的物理迁移,则实际运行的最大值小于MAX_CLONE_COURRENCY_NUM(5)。

greatdb_new_datanode_clone_threshold

PropertyValue
Command-Line Formatgreatdb_new_datanode_clone_threshold=#
System Variablegreatdb_new_datanode_clone_threshold
ScopeGlobal,session
Dynamicyes
TypeInterger
Default value65535
Min value1
Max value9223372036854775807
Version5.0.8

如果一个 shard 已经初始化,当该 shard 添加新的 datanode 时,可能存在数据延迟。当新节点相比 shard 集群现有数据节点的延迟事务数大于 greatdb_new_datanode_clone_threshold 时,会首先采用 clone 的方式获取最新数据,然后再通过mgr同步之后的增量数据。其目的是为了防止数据延迟过大时,新节点加入集群同步时间太长的问题。

greatdb_new_sqlnode_clone_threshold

PropertyValue
Command-Line Formatgreatdb_new_sqlnode_clone_threshold=#
System Variablegreatdb_new_sqlnode_clone_threshold
ScopeGlobal,session
Dynamicyes
TypeInterger
Default value1000
Min value1
Max value9223372036854775807
Version5.0.8

添加新的 sqlnode 时,可能存在数据延迟,当新节点相比集群现有 sqlnode 的延迟事务数大于 greatdb_new_sqlnode_clone_threshold 时,会首先采用 clone 的方式获取最新数据,然后再通过mgr同步之后的增量数据。其目的是为了防止数据延迟过大时,新节点加入集群同步时间太长的问题。

greatdb_node_time_diff_limit

PropertyValue
Command-Line Format--greatdb-node-time-diff-limit=#
System Variablegreatdb_node_time_diff_limit
ScopeGlobal
DynamicYes
Typeunsigned long
Default value2000
Min value1000
max value5000
Version5.0.8

向集群中增加一个sqlnode/datanode时,会判断当前集群的unix timestamp与需要加入到集群中的sqlnode/datanode的unix timestamp的差值应小于等于设定的greatdb_node_time_diff_limit的值。如果两者的差值大于greatdb_node_time_diff_limit的值,就会提示:"the time diff of the new datanode and the cluster exceeded xxx ms" 或者 "the time diff of the new sqlnode and the cluster exceeded xxx ms"。这时需要修改要加入到集群的sqlnode/datanode的系统时间与集群保持一致。或者可以通过set global greatdb_node_time_diff_limit=设置其大小,取值范围在[1000, 5000],默认是2000,单位为ms;设置其值的例子:set global greatdb_node_time_diff_limit = 1000;

greatdb_optimize_direct_delete

PropertyValue
Command-Line Formatgreatdb_optimize_direct_delete[={OFF|ON}]
System Variablegreatdb_optimize_direct_delete
ScopeSession
DynamicYes
Typebool
Default valuefalse
Version5.0.8

该参数默认为ON,表示当执行delete语句时,直接将delete语句发送给后端的datanode。

greatdb_optimize_multi_recs_update

PropertyValue
Command-Line Formatnot support command line argument
System Variablegreatdb_optimize_multi_recs_update
ScopeGlobal, Session
DynamicYes
TypeBool
Default valuetrue
Version5.0.8

update多条记录时开启优化策略。当更新语句涉及多条记录修改时,sqlnode会将语句改写为如下形式,减少sqlnode和datanode之间的网络交互次数。

update tu ,
       (select 1 as pk, 2 as value union all 
        select 2,2 union all
        select 3,2 union all 
        select 4,2 union all 
        select 5,2 union all 
        select 6,2 union all 
        select 7,2 union all 
        select 8,2 union all 
        select 9,2
       ) as v
   set tu.c2=v.value where tu.c1=v.pk;

greatdb_parallel_read_threads

PropertyValue
Command-Line Formatnot support command line argument
System Variablegreatdb_parallel_read_threads
ScopeSession
DynamicYES
TypeInterger
Default value4
Min value1
Max value256
Version5.0.8

当执行select count(*) from table时,通过set_var hint设置并行读线程的个数。

greatdb_physical_migrate_table

PropertyValue
Command-Line Formatgreatdb_physical_migrate_table[={OFF|ON}]
System Variablegreatdb_physical_migrate_table
ScopeGlobal, Session
DynamicYes
Typebool
Default valuetrue
Version5.0.8

是否启用物理迁移功能。

greatdb_physical_migrate_table_mode

PropertyValue
Command-Line Formatgreatdb_physical_migrate_table_mode[={LOCAL_COPY|CLONE_REMOTE}]
System Variablegreatdb_physical_migrate_table_mode
ScopeGlobal, Session
DynamicYes
TypeEnumeration
Default valuelocal_copy
Version6.0.2

该变量可以设置为local_copy,表示使用普通物理迁移;设置为clone_remote,表示基于clone的物理迁移。该变量生效的前提是参是greatdb_physical_migrate_table必须是ON。

greatdb_result_cache_batch_cnt

PropertyValue
Command-Line Formatgreatdb-result-cache-batch_cnt=cache_batch_cnt
System Variablegreatdb_result_cache_batch_cnt
ScopeGlobal
DynamicRead_only
TypeInterger
Default value1024
Min value1
Max value10240
Version6.0.3

当send_cache中单个shard缓存的行数达到该值时则向后端发送一次语句(normal表和global表)。对partition表,会根据单个shard缓存内涉及的后端分片表个数进行综合判断,尽量保证"总数/分片表数"达到接近本参数且趋于合理的值后再像向后端发送。

greatdb_result_cache_size

PropertyValue
Command-Line Formatgreatdb-result-cache-size=cache_size
System Variablegreatdb_result_cache_size
ScopeGlobal
DynamicRead_only
TypeInterger
Default value64k
Min value1K
Max value20M
Version5.0.8

当send_cache中单个shard缓存的内容达到该值的7/8时则向后端发送一次语句。建议最大配置值为4MB。单位字节。

greatdb_sync_autoincrement_interval

PropertyValue
Command-Line Formatnot support command line argument
System Variablegreatdb_sync_autoincrement_interval
ScopeGlobal
DynamicYes, No_persist
TypeInterger
Default value-1
Min value1
Max value86400000 ms
Version5.0.8

当该值为-1时,生成自增值时不向后端查询最大值

当该值为0时,每次生成自增值时均向后端查询最大值

当该值>0时,每次间隔greatdb_sync_autoincrement_interval*毫秒向后端查询最大值

greatdb_table_cache_size

PropertyValue
Command-Line Formatgreatdb-table-cache-size=tbl_dict_cache_size
System Variablegreatdb_table_cache_size
ScopeGlobal
DynamicYes
TypeInterger
Default value20480
Min value1
Max value524288
Version5.0.8

GreatDB存储引擎数据字典缓存表定义的容量个数

greatdb_upgrade_cluster

PropertyValue
Command-Line Formatgreatdb_upgrade_cluster[={OFF|ON}]
System Variablegreatdb_upgrade_cluster
ScopeGlobal
DynamicYes
Typebool
Default valuefalse
Version5.0.8

是否开启升级功能,如果开启将会禁止alter table, migrate table,backup, add/drop sqlnode/datanode/backup_node, and some other cluster procedure interface operation。

greatdb_version

PropertyValue
Command-Line Formatnot support command line
System Variablegreatdb_version
ScopeGlobal
DynamicConst
TypeString
Default valueGreatDB 存储引擎层版本号
Version5.0.8

该参数GreatDB 存储引擎层的版本号(只存在于sqlnode且安装GreatDB存储引擎之后)。如5.0.5.1。与之对应的参数有gdb_sqld_version

greatdb_connect_timeout

PropertyValue
Command-Line Formatgreatdb-connect-timeou=connect_timeout
System Variablegreatdb_connect_timeout
ScopeGlobal
DynamicYES
Typeunsigned int
Default value10
Min value3
Max value20
Version5.0.8

该参数是获取SQLNODE和DATANODE之间的连接时的超时时间。默认是10s。

greatdb_use_normal_transaction

PropertyValue
Command-Line Formatgreatdb-use-normal-transaction[={OFF|ON}]
System Variablegreatdb_use_normal_transaction
Scopesession
DynamicYES
Typebool
Default valuefalse
Version5.0.8

该参数表示是否使用普通事务而不是xa,默认为OFF表示不使用普通事务。

greatdb_data_file_async_purge
PropertyValue
Command-Line Formatgreatdb_data_file_async_purge[={OFF|ON}]
System Variablegreatdb_data_file_async_purge
ScopeGlobal, Session
DynamicYes
Typebool
Default valuefalse
Version6.0.1

GreatDB引擎表是否启用异步清理策略,可分别在session、global级别控制是否开启异步清理。

greatdb_enable_dtm

PropertyValue
Command-Line Formatgreatdb_enable_dtm=[={OFF|ON}]
System Variablegreatdb_enable_dtm
ScopeGlobal
DynamicRead_only
Typebool
Default valueOFF
Version5.1.8

当前SQLNode是否启用 DTM 分布式事务。如果要启用 DTM 分布式事务,GreatDB 集群中所有 SQLNode 都需要指定 greatdb_enable_dtm=ON。如果不是所有SQLNode指定greatdb_enable_dtm=ON,并不会报错,只是greatdb_enable_dtm=OFF的SQLNode依旧使用单机本地事务。如果要保证事务原子性,必须指定 greatdb_enable_xa=ON。

greatdb_dtm_server_candidate

PropertyValue
Command-Line Formatgreatdb_dtm_server_candidate=[={OFF|ON}]
System Variablegreatdb_dtm_server_candidate
ScopeGlobal
DynamicRead_only
Typebool
Default valueON
Version5.1.8

当前 SQLNode 是否可以成为DTM Server。greatdb_dtm_server_candidate只有在greatdb_enable_dtm=ON时才有意义,如果要保证 DTM 高可用,所有 SQLNode 都需要指定 greatdb_dtm_server_candidate=ON,greatdb_dtm_server_candidate=OFF的SQLNode无法成为DTM server,如果所有SQLNode都指定greatdb_dtm_server_candidate=OFF,GreatDB cluster无法提供事务操作。

greatdb_dtm_server_port

PropertyValue
Command-Line Formatgreatdb_dtm_server_port=#
System Variablegreatdb_dtm_server_port
ScopeGlobal
DynamicRead_only
TypeInterger
Default value10000
Min value1025
Max value65534
Version5.1.8

DTM Server 监听端口。当 DTM Server 启动后,DTM Server 的后端线程会在该端口监听连接请求。

greatdb_dtm_server_address

PropertyValue
Command-Line Formatnot support command line
System Variablegreatdb_dtm_server_address
ScopeGlobal
DynamicYes
Typestring
Default valueNULL
Version5.1.8

当前DTM server的地址,格式为ip:port:timestamp, 可以通过设置此参数值来手动连接到DTM server。timestamp为dtm server启动的时间戳。

greatdb_dtm_trx_timeout

PropertyValue
Command-Line Formatgreatdb_dtm_trx_timeout=#
System Variablegreatdb_dtm_trx_timeout
ScopeGlobal
DynamicRead_only
TypeInterger
Default value6
Min value0
Max value4294967295
Version5.1.8

DTM client超过此时间未接收到DTM server回复,会标记事务失败,触发DTM client重新连接DTM server。建议指定greatdb_dtm_trx_timeout为非0值,能够通过事务超时机制触发DTM client的重连。

greatdb_dtm_client_con_count

PropertyValue
Command-Line Formatgreatdb_dtm_client_con_count=#
System Variablegreatdb_dtm_client_con_count
ScopeGlobal
DynamicRead_only
TypeInterger
Default value1000
Min value1
Max value16384
Version5.1.8

DTM client重新连接DTM server时的重连尝试次数,超过此重连次数还未重连成功,自动重连失败,需要手动执行set global greatdb_dtm_server_address指令触发DTM client重连。

greatdb_dtm_client_con_interval

PropertyValue
Command-Line Formatgreatdb_dtm_client_con_interval=#
System Variablegreatdb_dtm_client_con_interval
ScopeGlobal
DynamicRead_only
TypeInterger
Default value5000
Min value1
Max value4294967295
Version5.1.8

DTM client重新连接DTM server时的重连间隔,单位:毫秒。

greatdb_dtm_client_connect_tries

PropertyValue
Command-Line Formatgreatdb_dtm_client_connect_tries=#
System Variablegreatdb_dtm_client_connect_tries
ScopeGlobal
DynamicRead_only
TypeInterger
Default value4
Min value1
Max value1000
Version5.1.8

用于设置DTM client连接DTM server的连接超时时间,超时时间以2的指数进行增长。网络不稳定时,可以调大greatdb_dtm_client_con_count来提高自动重连次数,调大greatdb_dtm_client_connect_tries提高连接超时时间。

greatdb_dtm_handshake_timeout

PropertyValue
Command-Line Formatgreatdb_dtm_handshake_timeout=#
System Variablegreatdb_dtm_handshake_timeout
ScopeGlobal
DynamicRead_only
TypeInterger
Default value1000
Min value1
Max value3600000
Version5.1.8

DTM内部server与client通信接收握手消息的超时时间,单位:毫秒。当网络延迟较大时,适当调大greatdb_dtm_handshake_timeout但不要超过greatdb_dtm_trx_timeout的一半, 避免因DTM内部通信网络超时导致连接失败。

greatdb_dtm_log_file

PropertyValue
Command-Line Formatgreatdb_dtm_log_file=#
System Variablegreatdb_dtm_log_file
ScopeGlobal
DynamicRead_only
Typestring
Default valueNULL
Version5.1.8

DTM 日志文件,如果未设置此参数,DTM日志与log_error日志在同一目录下,如果未设置log_error,DTM日志会写到/tmp目录下,DTM日志文件名拼接规则:dtmservice+greatdb_dtm_server_port.log。

greatdb_dtm_server_recv_concurrency

PropertyValue
Command-Line Formatgreatdb_dtm_server_recv_concurrency=#
System Variablegreatdb_dtm_server_recv_concurrency
ScopeGlobal
DynamicRead_only
TypeInterger
Default value8
Min value1
Max value64
Version5.1.8

DTM Server 端通信层用来接收 DTM Client 请求的并发线程数目。

greatdb_dtm_server_send_concurrency

PropertyValue
Command-Line Formatgreatdb_dtm_server_send_concurrency=#
System Variablegreatdb_dtm_server_send_concurrency
ScopeGlobal
DynamicRead_only
TypeInterger
Default value8
Min value1
Max value64
Version5.1.8

DTM Server 端通信层用来给 DTM Client 发送数据的并发线程数目。

greatdb_dtm_client_gen_view_concurrency

PropertyValue
Command-Line Formatgreatdb_dtm_client_gen_view_concurrency=#
System Variablegreatdb_dtm_client_gen_view_concurrency
ScopeGlobal
DynamicRead_only
TypeInterger
Default value8
Min value1
Max value64
Version5.1.8

DTM Client 用来生成活跃事务列表的并发线程数目。

greatdb_dtm_server_combine_snap

PropertyValue
Command-Line Formatgreatdb_dtm_server_combine_snap[={ON|OFF}]
System Variablegreatdb_dtm_server_combine_snap
ScopeGlobal
DynamicRead_only
TypeBool
Default valueON
Version5.1.8

DTM Servers 是否批量向 DTM Client 发送活跃事务列表,指定为ON时能够减少网络交互的开销,提升性能。

greatdb_dtm_client_incr_snap

PropertyValue
Command-Line Formatgreatdb_dtm_client_incr_snap[={ON|OFF}]
System Variablegreatdb_dtm_client_incr_snap
ScopeGlobal
DynamicRead_only
TypeBool
Default valueON
Version5.1.8

DTM Client 是否以增量的形式向 DataNode 发送活跃事务列表,指定为ON时SQLNode只向DataNode发送活跃事务列表中的增量部分,节省网络带宽。

greatdb_dtm_log_level

PropertyValue
Command-Line Formatgreatdb_dtm_log_level=#
System Variablegreatdb_dtm_log_level
ScopeGlobal
DynamicYES
TypeInterger
Default value3
Min value0
Max value5
Version5.1.8

DTM 日志输出级别,输出所有小于等于此级别的日志到dtm log文件,日志级别:DTM_FATAL=0,DTM_ERROR=1,DTM_WARNING=2,DTM_INFO=3,DTM_DEBUG=4,DTM_TRACE=5,日志级别越高输出的日志越多。

greatdb_dtm_server_reply_threads

PropertyValue
Command-Line Formatgreatdb_dtm_server_reply_threads=#
System Variablegreatdb_dtm_server_reply_threads
ScopeGlobal
DynamicRead_only
TypeInterger
Default value8
Min value1
Max value2048
Version5.1.8

DTM server端处理事务请求回复的线程数量。

greatdb_enable_dml_acquire_dtm_readview

PropertyValue
Command-Line Formatgreatdb_enable_dml_acquire_dtm_readview[={ON|OFF}]
System Variablegreatdb_enable_dml_acquire_dtm_readview
ScopeGlobal
DynamicYes
Typebool
Default valueOFF
Version5.1.8

DTM事务中insert、update、delete、replace into statement是否获取DTM readview,为OFF可以减少获取readviwe的网络交互开销,提升性能。

greatdb_enable_purge_dtm_xa_log

PropertyValue
Command-Line Formatgreatdb_enable_purge_dtm_xa_log[={ON|OFF}]
System Variablegreatdb_enable_purge_dtm_xa_log
ScopeGlobal
DynamicYes
Typebool
Default valueON
Version5.1.8

是否自动清理datanode的DTM xa log,即是否自动清理mysql.greatdb_dtm_xa_log表中数据。

greatdb_print_dtm_debug_info

PropertyValue
Command-Line Formatgreatdb_print_dtm_debug_info[={ON|OFF}]
System Variablegreatdb_print_dtm_debug_info
ScopeGlobal
DynamicYes
Typebool
Default valueOFF
Version5.1.8

是否打印DTM相关调试信息,调试信息可打印到DTM日志,也可打印到log_error日志。系统级别变量,可以动态修改。如果DTM出现异常,可以打开此参数输出DTM调试信息进行问题定位,注意日志打印量可能非常大,问题定位后需及时关闭此参数。

innodb_dtm_disable

PropertyValue
Command-Line Formatinnodb_dtm_disable[={ON|OFF}]
System Variableinnodb_dtm_disable
ScopeGlobal
DynamicRead_only
Typebool
Default valueOFF
Version5.1.8

DataNode为NODE_MGR模式时,此参数由程序内部设置,primary状态的DataNode参数值为OFF,secondary状态的DataNode参数值为ON;DataNode为NODE_SINGLE模式时,此参数由配置文件设置,如果GreatDB引擎要启用DTM事务,此参数需要设置为OFF。

greatdb_dtm_server_wait_sync_time

PropertyValue
Command-Line Formatgreatdb_dtm_server_wait_sync_time=#
System Variablegreatdb_dtm_server_wait_sync_time
ScopeGlobal
DynamicRead_only
TypeInterger
Default value3000
Min value0
Max value4294967295
Version5.1.8

DTM server出现时钟漂移时,DTM server启动事务时等待时钟同步的超时时间,单位毫秒,超过此时间DTM server还未完成时钟同步,事务启动失败。此参数值需要小于greatdb_dtm_trx_timeout值。

greatdb_dtm_trx_available

PropertyValue
Command-Line Formatnot support command line
System Variablegreatdb_dtm_trx_available
ScopeGlobal
DynamicRead_only
Typebool
Default valueOFF
Version5.1.8

用于显示DTM client是否正常提供服务。参数值由程序内部设置,不需要手动设置,DTM client启动成功后将此参数设置为ON,DTM client出现异常后将此参数设置为OFF。此参数有限制,只有在SQLNode状态为ONLINE时,greatdb_dtm_trx_available才能准确显示DTM状态,参数值为OFF时,greatdb_dtm_server_address为过时的DTM server地址。

greatdb_wait_non_running_xa_trx_before_dtm_start

PropertyValue
Command-Line Formatgreatdb_wait_non_running_xa_trx_before_dtm_start=#
System Variablegreatdb_wait_non_running_xa_trx_before_dtm_start
ScopeGlobal
DynamicYes
Typebool
Default valueON
Version5.1.8

DTM server因故障进行切换时,新的DTM server启动前是否会kill后端数据节点上的活跃事务的连接,直到没有活跃事务才启动DTM server服务。开启此参数能够保证DTM server切换瞬间的事务一致性。开启此参数需要启动performance_schema下的threads和events_transactions_current系统表。

greatdb_dtm_async_commit_level

PropertyValue
Command-Line Formatgreatdb_dtm_async_commit_level=#
System Variablegreatdb_dtm_async_commit_level
ScopeGlobal
DynamicRead_only
TypeInterger
Default value0
Min value0
Max value1
Version5.1.8

全局事务异步提交等级,参数取值会影响事务一致性。0——事务强一致性,保证集群全局事务一致性;1——事务弱一致性,保证单个sqlnode上事务的一致性。不建议生产环境开启此选项.

innodb_greatdb_non_dtm_upgrade_to_dtm

PropertyValue
Command-Line Formatinnodb_greatdb_non_dtm_upgrade_to_dtm=#
System Variableinnodb_greatdb_non_dtm_upgrade_to_dtm
ScopeGlobal
DynamicRead_only
Typebool
Default valueOFF
Version5.1.8

为非DTM版本升级到DTM版本服务。DTM版本第一次启动之前,需要打开此参数,启动DTM版本并确认成功后,必须关闭此参数并重启所有进程。此参数不能在运行过程中处于打开状态。

greatdb_dtm_readview_wakeup_count

PropertyValue
Command-Line Formatgreatdb_dtm_readview_wakeup_count=#
System Variablegreatdb_dtm_readview_wakeup_count
ScopeGlobal
DynamicRead_only
TypeInterger
Default value4
Min value1
Max value32
Version5.1.8

DTM client端唤醒请求readview事务的线程数。

greatdb_dtm_readview_read_count

PropertyValue
Command-Line Formatgreatdb_dtm_readview_read_count=#
System Variablegreatdb_dtm_readview_read_count
ScopeGlobal
DynamicRead_only
TypeInterger
Default value4
Min value1
Max value32
Version5.1.8

DTM client端生成readview的线程数,greatdb_dtm_client_gen_view_concurrency必须大于此参数并为此参数的整倍数。

greatdb_dtm_trx_async_commit

PropertyValue
Command-Line Formatgreatdb_dtm_trx_async_commit=#
System Variablegreatdb_dtm_trx_async_commit
ScopeGlobal
DynamicRead_only
Typebool
Default valueON
Version5.1.8

DTM事务提交时计算节点向数据节点发送XA COMMIT是否采用异步模式。启用异步提交能够提升性能。

greatdb_dtm_server_time_persist_timeout

PropertyValue
Command-Line Formatgreatdb_dtm_server_time_persist_timeout=#
System Variablegreatdb_dtm_server_time_persist_timeout
ScopeGlobal
DynamicRead_only
TypeInterger
Default value5
Min value0
Max value4294967295
Version6.0.0

DTM server启动事务时等待greatdb引擎持久化用于生成DTID的时间戳的超时时间,单位秒。要求小于greatdb_dtm_trx_timeout,为0表示无限等待。

greatdb_dtm_server_sqlnode_address

PropertyValue
Command-Line Formatnot support command line
System Variablegreatdb_dtm_server_sqlnode_address
ScopeGlobal
DynamicYes
Typestring
Default valueNULL
Version6.0.1

DTM server所属sqlnode的连接信息,格式为ip:port

greatdb_output_dtm_status

PropertyValue
Command-Line Formatgreatdb_output_dtm_status=#
System Variablegreatdb_output_dtm_status
ScopeGlobal
DynamicRead_only
TypeInterger
Default value0
Min value0
Max value2
Version6.0.2

show engine greatdb status是否展示DTM信息。

greatdb_dtm_trx_perf_track_frequency

PropertyValue
Command-Line Formatgreatdb_dtm_trx_perf_track_frequency=#
System Variablegreatdb_dtm_trx_perf_track_frequency
ScopeGlobal
DynamicRead_only
TypeInterger
Default value0
Min value0
Max value1073741824
Version6.0.2

show engine greatdb status DTM性能统计的采样频率,为0关闭DTM性能统计。详细说明见集群手册Show Dtm Status说明章节。

greatdb_dtm_client_id_generate_method

PropertyValue
Command-Line Formatgreatdb_dtm_client_id_generate_method[={GENERATE_BY_SERVER_ID|GENERATE_BY_SERVER_UUID}]
System Variablegreatdb_dtm_client_id_generate_method
ScopeGlobal
DynamicYes
TypeEnumeration
Default valueGENERATE_BY_SERVER_ID
Version6.0.3

DTM client id的生成方式。GENERATE_BY_SERVER_ID,client id=server_id; GENERATE_BY_SERVER_UUID,client id=select CRC32(@@server_uuid)。特别注意,修改server_id或者greatdb_dtm_client_id_generate_method之后,需要重启sqlnode或者切换DTM server使client id的修改生效。

状态属性详细说明

greatdb_cluster_initialized

PropertyValue
Status Variablegreatdb_cluster_initialized
ScopeGlobal
Typebool
Version5.0.8

该值标识sqlnode上是否已经初始化GreatDB cluster。

greatdb_cluster_name

PropertyValue
Status Variablegreatdb_cluster_name
ScopeGlobal
Typestring
Version5.0.8

当前集群的名称。

greatdb_cluster_user

PropertyValue
Status Variablegreatdb_cluster_user
ScopeGlobal
Typestring
Version5.0.8

集群各节点间创建连接使用的用户名。

greatdb_clone_protect_mode (internal use)

PropertyValue
Status Variablegreatdb_clone_protect_mode
ScopeGlobal
Typebool
Version5.0.8

内部使用。通过克隆插件添加sqlnode时使用的状态值。

greatdb_committing_trxs (internal use)

PropertyValue
Status Variablegreatdb_committing_trxs
ScopeGlobal
TypeInterger
Version5.0.8

内部使用。用于xa模式下添加备份任务

greatdb_delay_commit_requests (internal use)

PropertyValue
Status Variablegreatdb_delay_commit_requests
ScopeGlobal
Typebool
Version5.0.8

内部使用。用于xa模式下添加备份任务

greatdb_read_only_mode

PropertyValue
Status Variablegreatdb_read_only_mode
ScopeGlobal
Typebool
Version5.0.8

当为true时表示集群当前处于只读模式。

group_replication_zone_id

PropertyValue
Command-Line Formatgroup-replication-zone-id=#
System Variablegroup_replication_zone_id
ScopeGlobal
DynamicYes
TypeInterger
Default value0
Min value0
Max value8
Version5.0.8

官方MySQL不包含该特性,该特性由greatdb分支引入。

该参数用于标记在MySQL Group_replication复制组集群中,不同机房间的id值。其行为由group_replication_zone_id_sync_mode 控制。节点组复制过程中,不允许更改变量。

group_replication_zone_id_sync_mode

PropertyValue
Command-Line Formatgroup-replication-zone-id-sync-mode=#
System Variablegroup_replication_zone_id-sync-mode
ScopeGlobal
DynamicYes
Typeboolean
Default valueON
Version5.0.8

官方MySQL不包含该特性,该特性由greatdb分支引入。

该参数用于控制MySQL Group_replication集群中,不同机房的同步行为。需要保证mgr中所有节点配置相同的值,否则节点将加入不了mgr集群中。同时节点在运行mgr过程中,不允许更改变量。如果需要修改该变量值,需要先停止mgr集群,再修改。

  1. 当参数值为ON时,如果mgr集群中中存在多个zone-id,在节点不存在异常的情形下,在满足多数派协议基础上,需要保证每个zone-id中最少一个节点同步到最新数据;如果一个zone-id所关联的所有节点均出现故障,为了保持mgr集群的高可用,此时,不会保证该zone-id同步了最新数据。
  2. 当参数为OFF时,zone-id仅是一个标签。

greatdb_enable_deadlock_detection

PropertyValue
Command-Line Formatgreatdb-enable-deadlock-detection=[{OFF|ON}]
System Variablegreatdb_enable_deadlock_detection
ScopeGlobal
DynamicYes
Typebool
Default valuefalse
Version5.0.8

控制死锁检测后台任务是否执行,默认为OFF,可以动态调整。

greatdb_deadlock_detection_period

PropertyValue
Command-Line Formatgreatdb-deadlock-detection-period=deadlock_detection_period
System Variablegreatdb_deadlock_detection_period
ScopeGlobal
DynamicYES
Typeunsigned int
Default value30
Min value1
Max value300
Version5.0.8

控制死锁检测后台任务的检测频率,单位为s,默认为30,可以动态调整。

greatdb_deadlock_detection_record_in_log

PropertyValue
Command-Line Formatgreatdb-deadlock-detection-record_in_log=[{OFF|ON}]
System Variablegreatdb_deadlock_detection_record_in_log
ScopeGlobal
DynamicYES
Typebool
Default valuefalse
Version5.0.8

控制死锁检测的结果是否记录到error_log中,默认为OFF,可以动态调整。

greatdb_inject_sqlnode_info

PropertyValue
Command-Line Formatgreatdb-inject-sqlnode-info=[{OFF|ON}]
System Variablegreatdb_inject_sqlnode_info
ScopeGlobal, Session
DynamicYes
Typebool
Default valuetrue
Version5.0.8

该参数表示是否将SQLNode信息拼接到发送到后端的SQL语句中。默认参数是ON,表示开启该功能。

greatdb_records_in_range_from_dn

PropertyValue
Command-Line Formatgreatdb-records-in-range-from-dn=[{OFF|ON}]
System Variablegreatdb_records_in_range_from_dn
ScopeGlobal, Session
DynamicYes
Typebool
Default valuetrue
Version5.0.8

该参数表示是否从DataNode获取range区间内的数据条数。默认参数是ON,表示开启该功能。

greatdb_records_in_range_max_partitions

PropertyValue
Command-Line Formatgreatdb-records-in-range-max-partitions=max_partitions
System Variablegreatdb_records_in_range_max_partitions
ScopeGlobal, Session
DynamicYES
Typeunsigned long
Default value20
Min value1
Max value8192
Version5.0.8

该参数表示从DataNode获取records_in_range时允许的最大分区数。取值范围是[1, 8192],默认是20。

greatdb_rnd_pos_probe

PropertyValue
Command-Line Formatgreatdb-rnd-pos-probe=[{OFF|ON}]
System Variablegreatdb_rnd_pos_probe
ScopeGlobal
DynamicYes
Typebool
Default valuefalse
Version5.0.8

这个参数是一个greatdb的优化开关,在开关开启的情况,探测特定场景下:如果后续不再调用rnd_pos,忽略position()的调用,减少临时表、文件的写入,可以提升性能。默认为OFF,表示关闭。

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

文章被以下合辑收录

评论