后台节点管理接口
设置sqlnode节点系统变量
| 存储过程 | mysql.greatdb_set_var_for_all_sqlnodes |
|---|---|
| 作用 | 在任一 sqlnode 节点,可以通过调用存储过程,统一修改所有 sqlnode 节点的系统变量值 |
| 参数 | variable_name:需要修改的变量名称 value:修改的变量值 persist:是否需要将变量修改进行持久化,如果设置为 true,则数据节点重启后,修改仍生效;否则,数据节点重启后,结果为修改前的值 |
| 版本 | 5.0.8 |
示例:
> SELECT * FROM INFORMATION_SCHEMA.GREATDB_SQLNODE_VARIABLES
WHERE VARIABLE_NAME='max_connections';
+-----------------+-----------------+----------------+
| SQLNODE | VARIABLE_NAME | VARIABLE_VALUE |
+-----------------+-----------------+----------------+
| localhost:13000 | max_connections | 151 |
| 127.0.0.1:13002 | max_connections | 151 |
| 127.0.0.1:13004 | max_connections | 151 |
+-----------------+-----------------+----------------+
3 rows in set (0.06 sec)
> CALL mysql.greatdb_set_var_for_all_sqlnodes('max_connections', 100, 0);
Query OK, 1 row affected (0.03 sec)
> SELECT * FROM INFORMATION_SCHEMA.GREATDB_SQLNODE_VARIABLES
WHERE VARIABLE_NAME='max_connections';
+-----------------+-----------------+----------------+
| SQLNODE | VARIABLE_NAME | VARIABLE_VALUE |
+-----------------+-----------------+----------------+
| localhost:13000 | max_connections | 100 |
| 127.0.0.1:13002 | max_connections | 100 |
| 127.0.0.1:13004 | max_connections | 100 |
+-----------------+-----------------+----------------+
3 rows in set (0.05 sec)
该操作仅支持修改部分的系统变量值,当前支持修改的系统变量如下:
| 变量名 | 是否全局立即生效 |
|---|---|
| audit_log_enabled | 1 |
| audit_log_to_table | 1 |
| gdb_cluster_ddl_metalock | 0 |
| gdb_direct_processing | 0 |
| gdb_direct_pushdown_time_funcs | 0 |
| gdb_enable_xplan | 0 |
| gdb_strict_create_table | 0 |
| gdb_xplan_enable_const_pushdown | 0 |
| gdb_xplan_enable_multi_shards | 0 |
| general_log | 1 |
| greatdb_ddl_lock_backend_wait_timeout | 0 |
| greatdb_deadlock_detection_period | 1 |
| greatdb_enable_deadlock_detection | 1 |
| greatdb_enable_instant_add_column | 0 |
| greatdb_inject_sqlnode_info | 0 |
| greatdb_max_connections | 1 |
| greatdb_migrate_table_parallel_num | 1 |
| greatdb_optimize_direct_delete | 0 |
| greatdb_optimize_multi_recs_update | 0 |
| greatdb_physical_migrate_table | 0 |
| greatdb_physical_migrate_table_mode | 0 |
| greatdb_records_in_range_from_dn | 0 |
| greatdb_records_in_range_max_partitions | 0 |
| greatdb_result_cache_batch_cnt | 1 |
| greatdb_result_cache_size | 1 |
| greatdb_rnd_pos_probe | 1 |
| greatdb_sync_autoincrement_interval | 1 |
| greatdb_table_cache_size | 1 |
| greatdb_upgrade_cluster | 1 |
| group_replication_applier_batch_size_threshold | 1 |
| group_replication_clone_threshold | 1 |
| group_replication_ip_allowlist | 1 |
| group_replication_ip_whitelist | 1 |
| group_replication_transaction_size_limit | 1 |
| group_replication_unreachable_majority_timeout | 1 |
| innodb_buffer_pool_size | 1 |
| innodb_change_buffering | 1 |
| innodb_doublewrite | 1 |
| innodb_flush_log_at_trx_commit | 1 |
| innodb_spin_wait_delay | 1 |
| innodb_sync_spin_loops | 1 |
| innodb_thread_concurrency | 1 |
| join_buffer_size | 0 |
| long_query_time | 0 |
| max_binlog_cache_size | 1 |
| max_connections | 1 |
| max_prepared_stmt_count | 1 |
| replica_parallel_workers | 0 |
| slave_parallel_workers | 0 |
| sort_buffer_size | 0 |
| sync_binlog | 1 |
| table_definition_cache | 1 |
| table_open_cache | 1 |
| transaction_isolation | 0 |
如果用户需要修改之外的系统变量,需要连接到各个sqlnode并使用set命令直接设置,或参考拓展可设置的sqlnode/datanode变量。
注意:该存储过程会统一修改所有的 sqlnode 节点的变量,如果用户只需要设置某一个 sqlnode 节点,则直连该 sqlnode 节点,使用 MySQL 的 SET 语句即可。
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




