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
| Property | Value |
|---|---|
| Command-Line Format | gdb-add-network-cost[={OFF|ON}] |
| System Variable | gdb_add_network_cost |
| Scope | Global, Session |
| Dynamic | Yes |
| Type | bool |
| Default value | false |
| Version | 5.0.8 |
该参数影响优化器生成执行计划。当为true时,优化器将考虑datanode和sqlnode之间的网络开销。
gdb_backup_dir
| Property | Value |
|---|---|
| Command-Line Format | gdb-backup-dir=# |
| System Variable | gdb_backup_dir |
| Scope | Global |
| Dynamic | No_persist, Read_only |
| Type | String |
| Default value | NULL |
| Version | 5.0.8 |
该参数表示执行备份时,相关备份文件及增量binlog的在备份节点上的存储路径。
- 该值可以为空,但集群的备份节点需要配置非空参数
- 该值为一个合法的路径,否则数据库实例可能无法启动
- 数据库实例需要有该路径的访问权限,否则数据库实例可能无法启动
gdb_binlog_server
| Property | Value |
|---|---|
| Command-Line Format | gdb_binlog_server[={OFF|ON}] |
| System Variable | gdb_binlog_server |
| Scope | Global |
| Dynamic | No_persist, Read_only |
| Type | bool |
| Default value | false |
| Version | 5.0.8 |
该参数表示是否将该节点作为greatdb cluster binlog server节点。
gdb_binlog_server_slave_mode
| Property | Value |
|---|---|
| Command-Line Format | gdb_binlog_server_slave_mode[={OFF|ON}] |
| System Variable | gdb_binlog_server_slave_mode |
| Scope | Session |
| Dynamic | Yes |
| Type | bool |
| Default value | false |
| Version | 5.0.8 |
该参数设置为ON,并且gdb_binlog_server也设置为ON,将会按照binlog_server的方式应用binlog中的事件。
gdb_binlog_server_timediff
| Property | Value |
|---|---|
| Command-Line Format | not support command line |
| System Variable | gdb_binlog_server_timediff |
| Scope | Global |
| Dynamic | Yes |
| Type | unsigned long long |
| Default value | 0 |
| Version | 6.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
| Property | Value |
|---|---|
| Command-Line Format | not support command line |
| System Variable | gdb_ddl_id |
| Scope | Session |
| Dynamic | Yes |
| Type | unsigned long long |
| Default value | 0 |
| Version | 5.0.8 |
该参数表示greatdb cluster中每条DDL语句的id,并记录在binlog中。
gdb_ddl_sum
| Property | Value |
|---|---|
| Command-Line Format | not support command line |
| System Variable | gdb_ddl_sum |
| Scope | Session |
| Dynamic | Yes |
| Type | unsigned int |
| Default value | 0 |
| Version | 5.0.8 |
该参数表示greatdb cluster中DDL语句的总个数,并记录在binlog中。
gdb_direct_processing
| Property | Value |
|---|---|
| Command-Line Format | gdb-direct-processing[={OFF|ON}] |
| System Variable | gdb_direct_processing |
| Scope | Global, Session |
| Dynamic | Yes |
| Type | bool |
| Default value | false |
| Version | 5.0.8 |
该参数影响当前session是否启用direct processing优化。
gdb_encrypt_key_path
| Property | Value |
|---|---|
| Command-Line Format | gdb_encrypt_key_path=# |
| System Variable | gdb_encrypt_key_path |
| Scope | Global |
| Dynamic | yes |
| Type | String |
| Default value | NULL |
| Version | 6.0.0 |
该参数仅在备份节点上有效,表示执行备份时,是否开启加密备份,如果该参数指定为存放密钥文件的路径,则备份数据是加密的。
gdb_parallel_load
| Property | Value |
|---|---|
| Command-Line Format | not support command line |
| System Variable | gdb_parallel_load |
| Scope | Session_only |
| Dynamic | Yes |
| Type | bool |
| Default value | false |
| Version | 5.0.8 |
true表示开启并行导入功能。当执行load data infile 'infile' into table时,是否开启并行导入;
gdb_parallel_load_chunk_size
| Property | Value |
|---|---|
| Command-Line Format | not support command line |
| System Variable | gdb_parallel_load_chunk_size |
| Scope | Session |
| Dynamic | Yes |
| Type | interger |
| Default value | 1 MB |
| Min value | 64 KB |
| Max value | 128 MB |
| Version | 5.0.8 |
该参数表示当执行load data infile 'infile' into table时,开启并行导入时,每次导入文件块的大小;
gdb_parallel_load_workers
| Property | Value |
|---|---|
| Command-Line Format | not support command line |
| System Variable | gdb_parallel_load_workers |
| Scope | Session |
| Dynamic | Yes |
| Type | interger |
| Default value | 8 |
| Min value | 1 |
| Max value | 24 |
| Version | 5.0.8 |
该参数表示当执行load data infile 'infile' into table时,开启并行导入时,并行执行者的个数,默认为8;
gdb_split_outfile
| Property | Value |
|---|---|
| Command-Line Format | not support command line |
| System Variable | gdb_splice_outfile |
| Scope | Session_only |
| Dynamic | Yes |
| Type | bool |
| Default value | false |
| Version | 5.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
| Property | Value |
|---|---|
| Command-Line Format | not support command line |
| System Variable | gdb_splice_outfile_rotate_size |
| Scope | Global, Session |
| Dynamic | Yes |
| Type | interger |
| Default value | 1 MB |
| Min value | 64 bytes |
| max value | 128 MB |
| Version | 5.0.8 |
当gdb_split_outfile参数为true时,该参数有意义。执行select * into outfile 'outfile_path' from table时,当前文件的大小达到该值时,关闭当前文件并向一个新文件中写入。
gdb_split_outfile_wait_transport
| Property | Value |
|---|---|
| Command-Line Format | not support command line |
| System Variable | gdb_split_outfile_wait_transport |
| Scope | Session_only |
| Dynamic | Yes |
| Type | bool |
| Default value | false |
| Version | 5.0.8 |
该参数为true时,表当执行select ... into outfile时,将当前的文件拆分为多个小文件发送到不同的位置避免文件积压。默认为false。
gdb_sqld_version
| Property | Value |
|---|---|
| Command-Line Format | not support command line |
| System Variable | gdb_sqld_version |
| Scope | Global |
| Dynamic | Const |
| Type | String |
| Default value | GreatDB server层版本号 |
| Version | 5.0.8 |
该参数GreatDB server层的版本号(含datanode)。如5.0.5.1。与之对应的参数有greatdb_version,表示GreatDB存储引擎层的版本号。
gdb_sequence_force_frontend
| Property | Value |
|---|---|
| Command-Line Format | gdb-sequence-force-frontend[={OFF|ON}] |
| System Variable | gdb_sequence_force_frontend |
| Scope | Global |
| Dynamic | Yes |
| Type | bool |
| Default value | OFF |
| Version | 6.0.2 |
当参数为ON时,创建序列的backend选项会被忽略,并自动替换为frontend。受此影响,序列当前值持久化在当前节点、不再持久化到后端datanode,不再依赖greatdb engine。用于binlog server同步数据到单机实例。
gdb_strict_create_table
| Property | Value |
|---|---|
| Command-Line Format | gdb-strict-create-table[={OFF|ON}] |
| System Variable | gdb_strict_create_table |
| Scope | Global, Session |
| Dynamic | Yes |
| Type | bool |
| Default value | ON |
| Version | 5.0.8 |
当参数为ON(默认)时,当前session只能创建GreatDB存储引擎的表。如果用户需要创建其它引擎,如innodb表,可以将该参数设置为OFF。
gdb_zone_name
| Property | Value |
|---|---|
| Command-Line Format | gdb-zone-name=# |
| System Variable | gdb_zone_name |
| Scope | Global |
| Dynamic | Global |
| Type | string |
| Default value | DEFAULT |
| Version | 5.0.8 |
gdb_cluster_ddl_metalock
| Property | Value |
|---|---|
| Command-Line Format | gdb-cluster-ddl-metalock[={OFF|ON}] |
| System Variable | gdb_cluster_ddl_metalock |
| Scope | Global, Session |
| Dynamic | Yes |
| Type | bool |
| Default value | true |
| Version | 5.0.8 |
该参数表示在mgr环境中开启ddl的全局MDL锁。默认值为ON,表示开启该功能。
gdb_direct_pushdown_time_funcs
| Property | Value |
|---|---|
| Command-Line Format | gdb-direct-pushdown-time-funcs[={OFF|ON}] |
| System Variable | gdb_direct_pushdown_time_funcs |
| Scope | Global, Session |
| Dynamic | Yes |
| Type | bool |
| Default value | false |
| Version | 5.0.8 |
该参数是关于语句下推的,对于非partition表,下推sysdate、now函数到DATANODE,默认是关闭的。默认为false,表示不下推。
gdb_enable_xplan
| Property | Value |
|---|---|
| Command-Line Format | gdb-enable-xplan[={OFF|ON}] |
| System Variable | gdb_enable_xplan |
| Scope | Global, Session |
| Dynamic | Yes |
| Type | bool |
| Default value | false |
| Version | 5.0.8 |
该参数是xplan总开关,只开启该开关,非分区表可以使用xplan,默认为OFF。
gdb_xplan_enable_const_pushdown
| Property | Value |
|---|---|
| Command-Line Format | gdb-xplan-enable-const-pushdown[={OFF|ON}] |
| System Variable | gdb_xplan_enable_const_pushdown |
| Scope | Global, Session |
| Dynamic | Yes |
| Type | bool |
| Default value | false |
| Version | 6.0.0 |
该参数表示Xplan在开启的情况下,是否支持唯一索引列的等值查询的const table下推,默认为OFF。
gdb_xplan_enable_multi_shards
| Property | Value |
|---|---|
| Command-Line Format | gdb-xplan-enable-multi-shards[={OFF|ON}] |
| System Variable | gdb_xplan_enable_multi_shards |
| Scope | Global, Session |
| Dynamic | Yes |
| Type | bool |
| Default value | false |
| Version | 5.0.8 |
该参数表示在gdb_enable_xplan开关开启的情况下, 打开该开关,涉及分区表的计划可使用xplan,默认为OFF。
server_instance_type
| Property | Value |
|---|---|
| Command-Line Format | server-instance-type=instance_type |
| System Variable | server_instance_type |
| Scope | Global |
| Dynamic | Read_only |
| Type | Enumeration |
| Default value | NORMAL_NODE |
| Valid value | NORMAL_NODE, GREATDB_SQLNODE, GREATDB_DATANODE, GREATDB_BACKUP_NODE |
| Version | 5.0.8 |
标识当前数据库实例的类型
ora_emptystring_equal_null
| Property | Value |
|---|---|
| Command-Line Format | ora_emptystring_equal_null={OFF|ON} |
| System Variable | ora_emptystring_equal_null |
| Scope | Global, Session |
| Dynamic | Yes |
| Type | bool |
| Default value | OFF |
| Version | 5.0.8 |
标识当前数据比较、统计等操作时空串''与NULL是否等价
shrink_sql_mode
| Property | Value |
|---|---|
| Command-Line Format | --shrink_sql_mode=name |
| System Variable | shrink_sql_mode |
| Scope | Global, Session |
| Dynamic | YES |
| Type | SET |
| Default value | 0 |
| Valid value | ALLOW_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 |
| Version | 5.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
| Property | Value |
|---|---|
| Command-Line Format | not support command line |
| System Variable | enable_recycle_bin |
| Scope | Global |
| Dynamic | Const |
| Type | bool |
| Default value | OFF |
| Version | 5.0.8 |
该变量表示是否开启回收站功能,true表示开启回收站功能。默认是false,关闭回收站功能的。
show_dtid_enable_info
| Property | Value |
|---|---|
| Command-Line Format | show_dtid_enable_info=dtid_enable_info_level |
| System Variable | show_dtid_enable_info |
| Scope | Global, Session |
| Dynamic | YES |
| Type | Enumeration |
| Default value | ENABLE_DTID_INFO_OFF |
| Valid value | DTID_INFO_OFF, ENABLE_DTID_INFO_OFF, ENABLE_DTID_INFO_ON |
| Version | 6.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
| Property | Value |
|---|---|
| Command-Line Format | track_mvcc_dtm_footprint=# |
| System Variable | track_mvcc_dtm_footprint |
| Scope | Session |
| Dynamic | YES |
| Type | Unsigned long |
| Default value | 0 |
| Min value | 0 |
| max value | 16 |
| Version | 6.0.2 |
是否将可见性判断信息输入到error-log中, 0:不输出,> 0:输出。详细说明见集群手册Show Dtm Status说明章节。
greatdb_backend_table_engine
| Property | Value |
|---|---|
| Command-Line Format | greatdb-backend-table-engine=backend_engine_type |
| System Variable | greatdb_backend_table_engine |
| Scope | Global, Session |
| Dynamic | Yes |
| Type | String |
| Default value | InnoDB |
| Valid value | InnoDB, RocksDB |
| Version | 5.0.8 |
该值指定Greatdb在后端创建表时,后端表的存储引擎类型。目前只用InnoDB。
greatdb_change_primary_datanode_delay_threshold
| Property | Value |
|---|---|
| Command-Line Format | greatdb_change_primary_datanode_delay_threshold=#num |
| System Variable | greatdb_change_primary_datanode_delay_threshold |
| Scope | Global, Session |
| Dynamic | Yes |
| Type | Interger |
| Default value | 1000 |
| Min value | 1 |
| Max value | 1000000 |
| Version | 5.0.8 |
执行在线切主命令时call mysql.greatdb_change_shard_primary_node('shard_name', 'node_name')命令时,如果节点延迟太大时,切主命令可能执行较长时间,导致shard无法读写,为了防止上述问题,可以配置greatdb_change_primary_datanode_delay_threshold参数,指定允许的最大延迟事务gtid数,如果延迟超过该值,则拒绝用于切主请求。
greatdb_commit_hash
| Property | Value |
|---|---|
| Command-Line Format | not support command line |
| System Variable | greatdb_commit_hash |
| Scope | Global |
| Dynamic | Const |
| Type | String |
| Default value | GreatDB当前版本对应的commit hash |
| Version | 5.0.8 |
该值表示GreatDB二进制程序对应的代码commit hash值
greatdb_connection_keepalive_user_timeout
| Property | Value |
|---|---|
| Command-Line Format | greatdb-connection-keepalive-user-timeout=milliseconds |
| System Variable | greatdb_connection_keepalive_user_timeout |
| Scope | Global |
| Dynamic | Yes |
| Type | Interger |
| Min | 5000 |
| Max | 864000000 |
| Default value | 30000 |
| Version | 6.0.1 |
该值表示sqlnode到datanode连接池中连接的tcp keep alive user timeout参数值。
greatdb_ddl_lock_backend_wait_timeout
| Property | Value |
|---|---|
| Command-Line Format | not support command line |
| System Variable | greatdb_ddl_lock_backend_wait_timeout |
| Scope | Global, Session |
| Dynamic | Const |
| Type | Interger |
| Min | 1 |
| Max | 86400 (one day) |
| Default value | 600 |
| 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
| Property | Value |
|---|---|
| Command-Line Format | greatdb-debug-method=debug_method |
| System Variable | greatdb_debug_method |
| Scope | Session |
| Dynamic | Yes |
| Type | String |
| Default value | 空 |
| Valid value | cmd_service, task_alter_table |
| Version | 5.0.8 |
该参数表示触发的debug模式有cmd_service,task_alter_table。
greatdb_enable_force_init_cluster
| Property | Value |
|---|---|
| Command-Line Format | greatdb-enable-force-init-cluster[={OFF|ON}] |
| System Variable | greatdb_enable_force_init_cluster |
| Scope | Global |
| Dynamic | Read_only |
| Type | bool |
| Default value | false |
| Version | 5.0.8 |
在有脏数据的情况下强行初始化集群(调用init_cluster)接口
greatdb_enable_instant_add_column
| Property | Value |
|---|---|
| Command-Line Format | greatdb-enable-instant-add-column[={OFF|ON}] |
| System Variable | greatdb_enable_instant_add_column |
| Scope | Global, Session |
| Dynamic | Yes |
| Type | bool |
| Default value | false |
| Version | 6.0.0-RC-1 |
Alter table添加列时,是否启用instant add column快速加列。
greatdb_enable_xa
| Property | Value |
|---|---|
| Command-Line Format | greatdb-enable-xa[={OFF|ON}] |
| System Variable | greatdb_enable_xa |
| Scope | Global |
| Dynamic | Read_only |
| Type | bool |
| Default value | falsegreatdb-backend-table-engine |
| Version | 5.0.8 |
是否启用xa事务
greatdb_encrypt_key_file
| Property | Value |
|---|---|
| Command-Line Format | not support command line argure |
| System Variable | greatdb_encrypt_key_file |
| Scope | Global |
| Dynamic | Read_only, No_persist |
| Type | String |
| Default value | NULL |
| Version | 5.0.8 |
集群各节点间连接口令的加密key所在的文件。
greatdb_implicit_rollback_error_trx
| Property | Value |
|---|---|
| Command-Line Format | greatdb_implicit_rollback_error_trx[={OFF|ON}] |
| System Variable | greatdb_encrypt_key_file |
| Scope | Global |
| Dynamic | Yes |
| Type | bool |
| Default value | ON |
| Version | 5.0.8 |
由于greatdb中数据分布部署,用户层面一条SQL语句,可能同时修改多个节点的数据,此时可能出现部分执行成功,部分执行失败的场景。此时,需要回滚整个事务。该参数开启时,执行语句出现错误时,会隐式回滚整个事务,此时,执行下一条语句时,会开启一个新的事务。如果关闭该参数,则需要用户显示执行ROLLBACK语句,回滚整个事务,否则无法执行任何语句。需要注意的是,不管该参数开启还是关闭,和原生MySQL的行为均不一样。对比如下:
| 原生 MySQL | greatdb开启隐式提交 | greatdb关闭隐式提交 |
|---|---|---|
| BEGIN | BEGIN | BEGIN |
| INSERT (1) | INSERT (1) | INSERT (1) |
| INSERT (2) error | INSERT (2) error | INSERT (2) error |
| INSERT (3) | INSERT (3) | INSERT (3) error |
| COMMIT | COMMIT | ROLLBACK |
| SELECT * FROM t1 1, 3 | SELECT * FROM t1 3 | SELECT * FROM t1 empty set |
greatdb_is_restore_binlog_applier
| Property | Value |
|---|---|
| Command-Line Format | greatdb_is_restore_binlog_applier[={OFF|ON}] |
| System Variable | greatdb_is_restore_binlog_applier |
| Scope | Session |
| Dynamic | Yes |
| Type | bool |
| Default value | false |
| Version | 5.0.8 |
该参数表示恢复一个sqlnode时,是否重放binlog。默认为false。
greatdb_init_connections
| Property | Value |
|---|---|
| Command-Line Format | greatdb-init-connections=connections |
| System Variable | greatdb_init_connections |
| Scope | Global |
| Dynamic | Read_only |
| Type | unsigned int |
| Default value | 100 |
| Min value | 10 |
| Max value | 1024 |
| Version | 5.0.8 |
该参数表示每个SQLNode到每个DataNode的默认连接数,即初始化连接池中的连接个数。取值范围是[10, 1024],默认是100。
greatdb_max_connections
| Property | Value |
|---|---|
| Command-Line Format | greatdb-max-connections=conn_num |
| System Variable | greatdb_max_connections |
| Scope | Global |
| Dynamic | Read_only |
| Type | Interger |
| Default value | 1024 |
| Min value | 100 |
| Max value | 65536 |
| Version | 5.0.8 |
sqlnode到datanode连接池的最大连接数
greatdb_migrate_table_parallel_num
| Property | Value |
|---|---|
| Command-Line Format | not support command line argument |
| System Variable | greatdb_migrate_table_parallel_num |
| Scope | Global |
| Dynamic | Read_only |
| Type | Interger |
| Default value | 3 |
| Min value | 1 |
| Max value | 20 |
| Version | 5.0.8 |
表/集群迁移时,单个shard中最大并发子任务数。如果是基于clone的物理迁移,则实际运行的最大值小于MAX_CLONE_COURRENCY_NUM(5)。
greatdb_new_datanode_clone_threshold
| Property | Value |
|---|---|
| Command-Line Format | greatdb_new_datanode_clone_threshold=# |
| System Variable | greatdb_new_datanode_clone_threshold |
| Scope | Global,session |
| Dynamic | yes |
| Type | Interger |
| Default value | 65535 |
| Min value | 1 |
| Max value | 9223372036854775807 |
| Version | 5.0.8 |
如果一个 shard 已经初始化,当该 shard 添加新的 datanode 时,可能存在数据延迟。当新节点相比 shard 集群现有数据节点的延迟事务数大于 greatdb_new_datanode_clone_threshold 时,会首先采用 clone 的方式获取最新数据,然后再通过mgr同步之后的增量数据。其目的是为了防止数据延迟过大时,新节点加入集群同步时间太长的问题。
greatdb_new_sqlnode_clone_threshold
| Property | Value |
|---|---|
| Command-Line Format | greatdb_new_sqlnode_clone_threshold=# |
| System Variable | greatdb_new_sqlnode_clone_threshold |
| Scope | Global,session |
| Dynamic | yes |
| Type | Interger |
| Default value | 1000 |
| Min value | 1 |
| Max value | 9223372036854775807 |
| Version | 5.0.8 |
添加新的 sqlnode 时,可能存在数据延迟,当新节点相比集群现有 sqlnode 的延迟事务数大于 greatdb_new_sqlnode_clone_threshold 时,会首先采用 clone 的方式获取最新数据,然后再通过mgr同步之后的增量数据。其目的是为了防止数据延迟过大时,新节点加入集群同步时间太长的问题。
greatdb_node_time_diff_limit
| Property | Value |
|---|---|
| Command-Line Format | --greatdb-node-time-diff-limit=# |
| System Variable | greatdb_node_time_diff_limit |
| Scope | Global |
| Dynamic | Yes |
| Type | unsigned long |
| Default value | 2000 |
| Min value | 1000 |
| max value | 5000 |
| Version | 5.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
| Property | Value |
|---|---|
| Command-Line Format | greatdb_optimize_direct_delete[={OFF|ON}] |
| System Variable | greatdb_optimize_direct_delete |
| Scope | Session |
| Dynamic | Yes |
| Type | bool |
| Default value | false |
| Version | 5.0.8 |
该参数默认为ON,表示当执行delete语句时,直接将delete语句发送给后端的datanode。
greatdb_optimize_multi_recs_update
| Property | Value |
|---|---|
| Command-Line Format | not support command line argument |
| System Variable | greatdb_optimize_multi_recs_update |
| Scope | Global, Session |
| Dynamic | Yes |
| Type | Bool |
| Default value | true |
| Version | 5.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
| Property | Value |
|---|---|
| Command-Line Format | not support command line argument |
| System Variable | greatdb_parallel_read_threads |
| Scope | Session |
| Dynamic | YES |
| Type | Interger |
| Default value | 4 |
| Min value | 1 |
| Max value | 256 |
| Version | 5.0.8 |
当执行select count(*) from table时,通过set_var hint设置并行读线程的个数。
greatdb_physical_migrate_table
| Property | Value |
|---|---|
| Command-Line Format | greatdb_physical_migrate_table[={OFF|ON}] |
| System Variable | greatdb_physical_migrate_table |
| Scope | Global, Session |
| Dynamic | Yes |
| Type | bool |
| Default value | true |
| Version | 5.0.8 |
是否启用物理迁移功能。
greatdb_physical_migrate_table_mode
| Property | Value |
|---|---|
| Command-Line Format | greatdb_physical_migrate_table_mode[={LOCAL_COPY|CLONE_REMOTE}] |
| System Variable | greatdb_physical_migrate_table_mode |
| Scope | Global, Session |
| Dynamic | Yes |
| Type | Enumeration |
| Default value | local_copy |
| Version | 6.0.2 |
该变量可以设置为local_copy,表示使用普通物理迁移;设置为clone_remote,表示基于clone的物理迁移。该变量生效的前提是参是greatdb_physical_migrate_table必须是ON。
greatdb_result_cache_batch_cnt
| Property | Value |
|---|---|
| Command-Line Format | greatdb-result-cache-batch_cnt=cache_batch_cnt |
| System Variable | greatdb_result_cache_batch_cnt |
| Scope | Global |
| Dynamic | Read_only |
| Type | Interger |
| Default value | 1024 |
| Min value | 1 |
| Max value | 10240 |
| Version | 6.0.3 |
当send_cache中单个shard缓存的行数达到该值时则向后端发送一次语句(normal表和global表)。对partition表,会根据单个shard缓存内涉及的后端分片表个数进行综合判断,尽量保证"总数/分片表数"达到接近本参数且趋于合理的值后再像向后端发送。
greatdb_result_cache_size
| Property | Value |
|---|---|
| Command-Line Format | greatdb-result-cache-size=cache_size |
| System Variable | greatdb_result_cache_size |
| Scope | Global |
| Dynamic | Read_only |
| Type | Interger |
| Default value | 64k |
| Min value | 1K |
| Max value | 20M |
| Version | 5.0.8 |
当send_cache中单个shard缓存的内容达到该值的7/8时则向后端发送一次语句。建议最大配置值为4MB。单位字节。
greatdb_sync_autoincrement_interval
| Property | Value |
|---|---|
| Command-Line Format | not support command line argument |
| System Variable | greatdb_sync_autoincrement_interval |
| Scope | Global |
| Dynamic | Yes, No_persist |
| Type | Interger |
| Default value | -1 |
| Min value | 1 |
| Max value | 86400000 ms |
| Version | 5.0.8 |
当该值为-1时,生成自增值时不向后端查询最大值
当该值为0时,每次生成自增值时均向后端查询最大值
当该值>0时,每次间隔greatdb_sync_autoincrement_interval*毫秒向后端查询最大值
greatdb_table_cache_size
| Property | Value |
|---|---|
| Command-Line Format | greatdb-table-cache-size=tbl_dict_cache_size |
| System Variable | greatdb_table_cache_size |
| Scope | Global |
| Dynamic | Yes |
| Type | Interger |
| Default value | 20480 |
| Min value | 1 |
| Max value | 524288 |
| Version | 5.0.8 |
GreatDB存储引擎数据字典缓存表定义的容量个数
greatdb_upgrade_cluster
| Property | Value |
|---|---|
| Command-Line Format | greatdb_upgrade_cluster[={OFF|ON}] |
| System Variable | greatdb_upgrade_cluster |
| Scope | Global |
| Dynamic | Yes |
| Type | bool |
| Default value | false |
| Version | 5.0.8 |
是否开启升级功能,如果开启将会禁止alter table, migrate table,backup, add/drop sqlnode/datanode/backup_node, and some other cluster procedure interface operation。
greatdb_version
| Property | Value |
|---|---|
| Command-Line Format | not support command line |
| System Variable | greatdb_version |
| Scope | Global |
| Dynamic | Const |
| Type | String |
| Default value | GreatDB 存储引擎层版本号 |
| Version | 5.0.8 |
该参数GreatDB 存储引擎层的版本号(只存在于sqlnode且安装GreatDB存储引擎之后)。如5.0.5.1。与之对应的参数有gdb_sqld_version。
greatdb_connect_timeout
| Property | Value |
|---|---|
| Command-Line Format | greatdb-connect-timeou=connect_timeout |
| System Variable | greatdb_connect_timeout |
| Scope | Global |
| Dynamic | YES |
| Type | unsigned int |
| Default value | 10 |
| Min value | 3 |
| Max value | 20 |
| Version | 5.0.8 |
该参数是获取SQLNODE和DATANODE之间的连接时的超时时间。默认是10s。
greatdb_use_normal_transaction
| Property | Value |
|---|---|
| Command-Line Format | greatdb-use-normal-transaction[={OFF|ON}] |
| System Variable | greatdb_use_normal_transaction |
| Scope | session |
| Dynamic | YES |
| Type | bool |
| Default value | false |
| Version | 5.0.8 |
该参数表示是否使用普通事务而不是xa,默认为OFF表示不使用普通事务。
greatdb_data_file_async_purge
| Property | Value |
|---|---|
| Command-Line Format | greatdb_data_file_async_purge[={OFF|ON}] |
| System Variable | greatdb_data_file_async_purge |
| Scope | Global, Session |
| Dynamic | Yes |
| Type | bool |
| Default value | false |
| Version | 6.0.1 |
GreatDB引擎表是否启用异步清理策略,可分别在session、global级别控制是否开启异步清理。
greatdb_enable_dtm
| Property | Value |
|---|---|
| Command-Line Format | greatdb_enable_dtm=[={OFF|ON}] |
| System Variable | greatdb_enable_dtm |
| Scope | Global |
| Dynamic | Read_only |
| Type | bool |
| Default value | OFF |
| Version | 5.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
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_server_candidate=[={OFF|ON}] |
| System Variable | greatdb_dtm_server_candidate |
| Scope | Global |
| Dynamic | Read_only |
| Type | bool |
| Default value | ON |
| Version | 5.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
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_server_port=# |
| System Variable | greatdb_dtm_server_port |
| Scope | Global |
| Dynamic | Read_only |
| Type | Interger |
| Default value | 10000 |
| Min value | 1025 |
| Max value | 65534 |
| Version | 5.1.8 |
DTM Server 监听端口。当 DTM Server 启动后,DTM Server 的后端线程会在该端口监听连接请求。
greatdb_dtm_server_address
| Property | Value |
|---|---|
| Command-Line Format | not support command line |
| System Variable | greatdb_dtm_server_address |
| Scope | Global |
| Dynamic | Yes |
| Type | string |
| Default value | NULL |
| Version | 5.1.8 |
当前DTM server的地址,格式为ip:port:timestamp, 可以通过设置此参数值来手动连接到DTM server。timestamp为dtm server启动的时间戳。
greatdb_dtm_trx_timeout
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_trx_timeout=# |
| System Variable | greatdb_dtm_trx_timeout |
| Scope | Global |
| Dynamic | Read_only |
| Type | Interger |
| Default value | 6 |
| Min value | 0 |
| Max value | 4294967295 |
| Version | 5.1.8 |
DTM client超过此时间未接收到DTM server回复,会标记事务失败,触发DTM client重新连接DTM server。建议指定greatdb_dtm_trx_timeout为非0值,能够通过事务超时机制触发DTM client的重连。
greatdb_dtm_client_con_count
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_client_con_count=# |
| System Variable | greatdb_dtm_client_con_count |
| Scope | Global |
| Dynamic | Read_only |
| Type | Interger |
| Default value | 1000 |
| Min value | 1 |
| Max value | 16384 |
| Version | 5.1.8 |
DTM client重新连接DTM server时的重连尝试次数,超过此重连次数还未重连成功,自动重连失败,需要手动执行set global greatdb_dtm_server_address指令触发DTM client重连。
greatdb_dtm_client_con_interval
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_client_con_interval=# |
| System Variable | greatdb_dtm_client_con_interval |
| Scope | Global |
| Dynamic | Read_only |
| Type | Interger |
| Default value | 5000 |
| Min value | 1 |
| Max value | 4294967295 |
| Version | 5.1.8 |
DTM client重新连接DTM server时的重连间隔,单位:毫秒。
greatdb_dtm_client_connect_tries
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_client_connect_tries=# |
| System Variable | greatdb_dtm_client_connect_tries |
| Scope | Global |
| Dynamic | Read_only |
| Type | Interger |
| Default value | 4 |
| Min value | 1 |
| Max value | 1000 |
| Version | 5.1.8 |
用于设置DTM client连接DTM server的连接超时时间,超时时间以2的指数进行增长。网络不稳定时,可以调大greatdb_dtm_client_con_count来提高自动重连次数,调大greatdb_dtm_client_connect_tries提高连接超时时间。
greatdb_dtm_handshake_timeout
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_handshake_timeout=# |
| System Variable | greatdb_dtm_handshake_timeout |
| Scope | Global |
| Dynamic | Read_only |
| Type | Interger |
| Default value | 1000 |
| Min value | 1 |
| Max value | 3600000 |
| Version | 5.1.8 |
DTM内部server与client通信接收握手消息的超时时间,单位:毫秒。当网络延迟较大时,适当调大greatdb_dtm_handshake_timeout但不要超过greatdb_dtm_trx_timeout的一半, 避免因DTM内部通信网络超时导致连接失败。
greatdb_dtm_log_file
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_log_file=# |
| System Variable | greatdb_dtm_log_file |
| Scope | Global |
| Dynamic | Read_only |
| Type | string |
| Default value | NULL |
| Version | 5.1.8 |
DTM 日志文件,如果未设置此参数,DTM日志与log_error日志在同一目录下,如果未设置log_error,DTM日志会写到/tmp目录下,DTM日志文件名拼接规则:dtmservice+greatdb_dtm_server_port.log。
greatdb_dtm_server_recv_concurrency
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_server_recv_concurrency=# |
| System Variable | greatdb_dtm_server_recv_concurrency |
| Scope | Global |
| Dynamic | Read_only |
| Type | Interger |
| Default value | 8 |
| Min value | 1 |
| Max value | 64 |
| Version | 5.1.8 |
DTM Server 端通信层用来接收 DTM Client 请求的并发线程数目。
greatdb_dtm_server_send_concurrency
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_server_send_concurrency=# |
| System Variable | greatdb_dtm_server_send_concurrency |
| Scope | Global |
| Dynamic | Read_only |
| Type | Interger |
| Default value | 8 |
| Min value | 1 |
| Max value | 64 |
| Version | 5.1.8 |
DTM Server 端通信层用来给 DTM Client 发送数据的并发线程数目。
greatdb_dtm_client_gen_view_concurrency
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_client_gen_view_concurrency=# |
| System Variable | greatdb_dtm_client_gen_view_concurrency |
| Scope | Global |
| Dynamic | Read_only |
| Type | Interger |
| Default value | 8 |
| Min value | 1 |
| Max value | 64 |
| Version | 5.1.8 |
DTM Client 用来生成活跃事务列表的并发线程数目。
greatdb_dtm_server_combine_snap
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_server_combine_snap[={ON|OFF}] |
| System Variable | greatdb_dtm_server_combine_snap |
| Scope | Global |
| Dynamic | Read_only |
| Type | Bool |
| Default value | ON |
| Version | 5.1.8 |
DTM Servers 是否批量向 DTM Client 发送活跃事务列表,指定为ON时能够减少网络交互的开销,提升性能。
greatdb_dtm_client_incr_snap
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_client_incr_snap[={ON|OFF}] |
| System Variable | greatdb_dtm_client_incr_snap |
| Scope | Global |
| Dynamic | Read_only |
| Type | Bool |
| Default value | ON |
| Version | 5.1.8 |
DTM Client 是否以增量的形式向 DataNode 发送活跃事务列表,指定为ON时SQLNode只向DataNode发送活跃事务列表中的增量部分,节省网络带宽。
greatdb_dtm_log_level
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_log_level=# |
| System Variable | greatdb_dtm_log_level |
| Scope | Global |
| Dynamic | YES |
| Type | Interger |
| Default value | 3 |
| Min value | 0 |
| Max value | 5 |
| Version | 5.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
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_server_reply_threads=# |
| System Variable | greatdb_dtm_server_reply_threads |
| Scope | Global |
| Dynamic | Read_only |
| Type | Interger |
| Default value | 8 |
| Min value | 1 |
| Max value | 2048 |
| Version | 5.1.8 |
DTM server端处理事务请求回复的线程数量。
greatdb_enable_dml_acquire_dtm_readview
| Property | Value |
|---|---|
| Command-Line Format | greatdb_enable_dml_acquire_dtm_readview[={ON|OFF}] |
| System Variable | greatdb_enable_dml_acquire_dtm_readview |
| Scope | Global |
| Dynamic | Yes |
| Type | bool |
| Default value | OFF |
| Version | 5.1.8 |
DTM事务中insert、update、delete、replace into statement是否获取DTM readview,为OFF可以减少获取readviwe的网络交互开销,提升性能。
greatdb_enable_purge_dtm_xa_log
| Property | Value |
|---|---|
| Command-Line Format | greatdb_enable_purge_dtm_xa_log[={ON|OFF}] |
| System Variable | greatdb_enable_purge_dtm_xa_log |
| Scope | Global |
| Dynamic | Yes |
| Type | bool |
| Default value | ON |
| Version | 5.1.8 |
是否自动清理datanode的DTM xa log,即是否自动清理mysql.greatdb_dtm_xa_log表中数据。
greatdb_print_dtm_debug_info
| Property | Value |
|---|---|
| Command-Line Format | greatdb_print_dtm_debug_info[={ON|OFF}] |
| System Variable | greatdb_print_dtm_debug_info |
| Scope | Global |
| Dynamic | Yes |
| Type | bool |
| Default value | OFF |
| Version | 5.1.8 |
是否打印DTM相关调试信息,调试信息可打印到DTM日志,也可打印到log_error日志。系统级别变量,可以动态修改。如果DTM出现异常,可以打开此参数输出DTM调试信息进行问题定位,注意日志打印量可能非常大,问题定位后需及时关闭此参数。
innodb_dtm_disable
| Property | Value |
|---|---|
| Command-Line Format | innodb_dtm_disable[={ON|OFF}] |
| System Variable | innodb_dtm_disable |
| Scope | Global |
| Dynamic | Read_only |
| Type | bool |
| Default value | OFF |
| Version | 5.1.8 |
DataNode为NODE_MGR模式时,此参数由程序内部设置,primary状态的DataNode参数值为OFF,secondary状态的DataNode参数值为ON;DataNode为NODE_SINGLE模式时,此参数由配置文件设置,如果GreatDB引擎要启用DTM事务,此参数需要设置为OFF。
greatdb_dtm_server_wait_sync_time
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_server_wait_sync_time=# |
| System Variable | greatdb_dtm_server_wait_sync_time |
| Scope | Global |
| Dynamic | Read_only |
| Type | Interger |
| Default value | 3000 |
| Min value | 0 |
| Max value | 4294967295 |
| Version | 5.1.8 |
DTM server出现时钟漂移时,DTM server启动事务时等待时钟同步的超时时间,单位毫秒,超过此时间DTM server还未完成时钟同步,事务启动失败。此参数值需要小于greatdb_dtm_trx_timeout值。
greatdb_dtm_trx_available
| Property | Value |
|---|---|
| Command-Line Format | not support command line |
| System Variable | greatdb_dtm_trx_available |
| Scope | Global |
| Dynamic | Read_only |
| Type | bool |
| Default value | OFF |
| Version | 5.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
| Property | Value |
|---|---|
| Command-Line Format | greatdb_wait_non_running_xa_trx_before_dtm_start=# |
| System Variable | greatdb_wait_non_running_xa_trx_before_dtm_start |
| Scope | Global |
| Dynamic | Yes |
| Type | bool |
| Default value | ON |
| Version | 5.1.8 |
DTM server因故障进行切换时,新的DTM server启动前是否会kill后端数据节点上的活跃事务的连接,直到没有活跃事务才启动DTM server服务。开启此参数能够保证DTM server切换瞬间的事务一致性。开启此参数需要启动performance_schema下的threads和events_transactions_current系统表。
greatdb_dtm_async_commit_level
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_async_commit_level=# |
| System Variable | greatdb_dtm_async_commit_level |
| Scope | Global |
| Dynamic | Read_only |
| Type | Interger |
| Default value | 0 |
| Min value | 0 |
| Max value | 1 |
| Version | 5.1.8 |
全局事务异步提交等级,参数取值会影响事务一致性。0——事务强一致性,保证集群全局事务一致性;1——事务弱一致性,保证单个sqlnode上事务的一致性。不建议生产环境开启此选项.
innodb_greatdb_non_dtm_upgrade_to_dtm
| Property | Value |
|---|---|
| Command-Line Format | innodb_greatdb_non_dtm_upgrade_to_dtm=# |
| System Variable | innodb_greatdb_non_dtm_upgrade_to_dtm |
| Scope | Global |
| Dynamic | Read_only |
| Type | bool |
| Default value | OFF |
| Version | 5.1.8 |
为非DTM版本升级到DTM版本服务。DTM版本第一次启动之前,需要打开此参数,启动DTM版本并确认成功后,必须关闭此参数并重启所有进程。此参数不能在运行过程中处于打开状态。
greatdb_dtm_readview_wakeup_count
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_readview_wakeup_count=# |
| System Variable | greatdb_dtm_readview_wakeup_count |
| Scope | Global |
| Dynamic | Read_only |
| Type | Interger |
| Default value | 4 |
| Min value | 1 |
| Max value | 32 |
| Version | 5.1.8 |
DTM client端唤醒请求readview事务的线程数。
greatdb_dtm_readview_read_count
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_readview_read_count=# |
| System Variable | greatdb_dtm_readview_read_count |
| Scope | Global |
| Dynamic | Read_only |
| Type | Interger |
| Default value | 4 |
| Min value | 1 |
| Max value | 32 |
| Version | 5.1.8 |
DTM client端生成readview的线程数,greatdb_dtm_client_gen_view_concurrency必须大于此参数并为此参数的整倍数。
greatdb_dtm_trx_async_commit
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_trx_async_commit=# |
| System Variable | greatdb_dtm_trx_async_commit |
| Scope | Global |
| Dynamic | Read_only |
| Type | bool |
| Default value | ON |
| Version | 5.1.8 |
DTM事务提交时计算节点向数据节点发送XA COMMIT是否采用异步模式。启用异步提交能够提升性能。
greatdb_dtm_server_time_persist_timeout
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_server_time_persist_timeout=# |
| System Variable | greatdb_dtm_server_time_persist_timeout |
| Scope | Global |
| Dynamic | Read_only |
| Type | Interger |
| Default value | 5 |
| Min value | 0 |
| Max value | 4294967295 |
| Version | 6.0.0 |
DTM server启动事务时等待greatdb引擎持久化用于生成DTID的时间戳的超时时间,单位秒。要求小于greatdb_dtm_trx_timeout,为0表示无限等待。
greatdb_dtm_server_sqlnode_address
| Property | Value |
|---|---|
| Command-Line Format | not support command line |
| System Variable | greatdb_dtm_server_sqlnode_address |
| Scope | Global |
| Dynamic | Yes |
| Type | string |
| Default value | NULL |
| Version | 6.0.1 |
DTM server所属sqlnode的连接信息,格式为ip:port
greatdb_output_dtm_status
| Property | Value |
|---|---|
| Command-Line Format | greatdb_output_dtm_status=# |
| System Variable | greatdb_output_dtm_status |
| Scope | Global |
| Dynamic | Read_only |
| Type | Interger |
| Default value | 0 |
| Min value | 0 |
| Max value | 2 |
| Version | 6.0.2 |
show engine greatdb status是否展示DTM信息。
greatdb_dtm_trx_perf_track_frequency
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_trx_perf_track_frequency=# |
| System Variable | greatdb_dtm_trx_perf_track_frequency |
| Scope | Global |
| Dynamic | Read_only |
| Type | Interger |
| Default value | 0 |
| Min value | 0 |
| Max value | 1073741824 |
| Version | 6.0.2 |
show engine greatdb status DTM性能统计的采样频率,为0关闭DTM性能统计。详细说明见集群手册Show Dtm Status说明章节。
greatdb_dtm_client_id_generate_method
| Property | Value |
|---|---|
| Command-Line Format | greatdb_dtm_client_id_generate_method[={GENERATE_BY_SERVER_ID|GENERATE_BY_SERVER_UUID}] |
| System Variable | greatdb_dtm_client_id_generate_method |
| Scope | Global |
| Dynamic | Yes |
| Type | Enumeration |
| Default value | GENERATE_BY_SERVER_ID |
| Version | 6.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
| Property | Value |
|---|---|
| Status Variable | greatdb_cluster_initialized |
| Scope | Global |
| Type | bool |
| Version | 5.0.8 |
该值标识sqlnode上是否已经初始化GreatDB cluster。
greatdb_cluster_name
| Property | Value |
|---|---|
| Status Variable | greatdb_cluster_name |
| Scope | Global |
| Type | string |
| Version | 5.0.8 |
当前集群的名称。
greatdb_cluster_user
| Property | Value |
|---|---|
| Status Variable | greatdb_cluster_user |
| Scope | Global |
| Type | string |
| Version | 5.0.8 |
集群各节点间创建连接使用的用户名。
greatdb_clone_protect_mode (internal use)
| Property | Value |
|---|---|
| Status Variable | greatdb_clone_protect_mode |
| Scope | Global |
| Type | bool |
| Version | 5.0.8 |
内部使用。通过克隆插件添加sqlnode时使用的状态值。
greatdb_committing_trxs (internal use)
| Property | Value |
|---|---|
| Status Variable | greatdb_committing_trxs |
| Scope | Global |
| Type | Interger |
| Version | 5.0.8 |
内部使用。用于xa模式下添加备份任务
greatdb_delay_commit_requests (internal use)
| Property | Value |
|---|---|
| Status Variable | greatdb_delay_commit_requests |
| Scope | Global |
| Type | bool |
| Version | 5.0.8 |
内部使用。用于xa模式下添加备份任务
greatdb_read_only_mode
| Property | Value |
|---|---|
| Status Variable | greatdb_read_only_mode |
| Scope | Global |
| Type | bool |
| Version | 5.0.8 |
当为true时表示集群当前处于只读模式。
group_replication_zone_id
| Property | Value |
|---|---|
| Command-Line Format | group-replication-zone-id=# |
| System Variable | group_replication_zone_id |
| Scope | Global |
| Dynamic | Yes |
| Type | Interger |
| Default value | 0 |
| Min value | 0 |
| Max value | 8 |
| Version | 5.0.8 |
官方MySQL不包含该特性,该特性由greatdb分支引入。
该参数用于标记在MySQL Group_replication复制组集群中,不同机房间的id值。其行为由group_replication_zone_id_sync_mode 控制。节点组复制过程中,不允许更改变量。
group_replication_zone_id_sync_mode
| Property | Value |
|---|---|
| Command-Line Format | group-replication-zone-id-sync-mode=# |
| System Variable | group_replication_zone_id-sync-mode |
| Scope | Global |
| Dynamic | Yes |
| Type | boolean |
| Default value | ON |
| Version | 5.0.8 |
官方MySQL不包含该特性,该特性由greatdb分支引入。
该参数用于控制MySQL Group_replication集群中,不同机房的同步行为。需要保证mgr中所有节点配置相同的值,否则节点将加入不了mgr集群中。同时节点在运行mgr过程中,不允许更改变量。如果需要修改该变量值,需要先停止mgr集群,再修改。
- 当参数值为ON时,如果mgr集群中中存在多个zone-id,在节点不存在异常的情形下,在满足多数派协议基础上,需要保证每个zone-id中最少一个节点同步到最新数据;如果一个zone-id所关联的所有节点均出现故障,为了保持mgr集群的高可用,此时,不会保证该zone-id同步了最新数据。
- 当参数为OFF时,zone-id仅是一个标签。
greatdb_enable_deadlock_detection
| Property | Value |
|---|---|
| Command-Line Format | greatdb-enable-deadlock-detection=[{OFF|ON}] |
| System Variable | greatdb_enable_deadlock_detection |
| Scope | Global |
| Dynamic | Yes |
| Type | bool |
| Default value | false |
| Version | 5.0.8 |
控制死锁检测后台任务是否执行,默认为OFF,可以动态调整。
greatdb_deadlock_detection_period
| Property | Value |
|---|---|
| Command-Line Format | greatdb-deadlock-detection-period=deadlock_detection_period |
| System Variable | greatdb_deadlock_detection_period |
| Scope | Global |
| Dynamic | YES |
| Type | unsigned int |
| Default value | 30 |
| Min value | 1 |
| Max value | 300 |
| Version | 5.0.8 |
控制死锁检测后台任务的检测频率,单位为s,默认为30,可以动态调整。
greatdb_deadlock_detection_record_in_log
| Property | Value |
|---|---|
| Command-Line Format | greatdb-deadlock-detection-record_in_log=[{OFF|ON}] |
| System Variable | greatdb_deadlock_detection_record_in_log |
| Scope | Global |
| Dynamic | YES |
| Type | bool |
| Default value | false |
| Version | 5.0.8 |
控制死锁检测的结果是否记录到error_log中,默认为OFF,可以动态调整。
greatdb_inject_sqlnode_info
| Property | Value |
|---|---|
| Command-Line Format | greatdb-inject-sqlnode-info=[{OFF|ON}] |
| System Variable | greatdb_inject_sqlnode_info |
| Scope | Global, Session |
| Dynamic | Yes |
| Type | bool |
| Default value | true |
| Version | 5.0.8 |
该参数表示是否将SQLNode信息拼接到发送到后端的SQL语句中。默认参数是ON,表示开启该功能。
greatdb_records_in_range_from_dn
| Property | Value |
|---|---|
| Command-Line Format | greatdb-records-in-range-from-dn=[{OFF|ON}] |
| System Variable | greatdb_records_in_range_from_dn |
| Scope | Global, Session |
| Dynamic | Yes |
| Type | bool |
| Default value | true |
| Version | 5.0.8 |
该参数表示是否从DataNode获取range区间内的数据条数。默认参数是ON,表示开启该功能。
greatdb_records_in_range_max_partitions
| Property | Value |
|---|---|
| Command-Line Format | greatdb-records-in-range-max-partitions=max_partitions |
| System Variable | greatdb_records_in_range_max_partitions |
| Scope | Global, Session |
| Dynamic | YES |
| Type | unsigned long |
| Default value | 20 |
| Min value | 1 |
| Max value | 8192 |
| Version | 5.0.8 |
该参数表示从DataNode获取records_in_range时允许的最大分区数。取值范围是[1, 8192],默认是20。
greatdb_rnd_pos_probe
| Property | Value |
|---|---|
| Command-Line Format | greatdb-rnd-pos-probe=[{OFF|ON}] |
| System Variable | greatdb_rnd_pos_probe |
| Scope | Global |
| Dynamic | Yes |
| Type | bool |
| Default value | false |
| Version | 5.0.8 |
这个参数是一个greatdb的优化开关,在开关开启的情况,探测特定场景下:如果后续不再调用rnd_pos,忽略position()的调用,减少临时表、文件的写入,可以提升性能。默认为OFF,表示关闭。




