radondb-mysql-kubernetes icon indicating copy to clipboard operation
radondb-mysql-kubernetes copied to clipboard

[feature] Support dynamic update MySQL configuration.

Open runkecheng opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe.

Only some parameters must be restarted to take effect.

	"default-storage-engine":      "InnoDB",
	"back_log":                    "2048",
	"ft_min_word_len":             "4",
	"lower_case_table_names":      "0",
	"innodb_ft_max_token_size":    "84",
	"innodb_ft_min_token_size":    "3",
	"sql_mode":                    "STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION",
	"slave_parallel_workers":      "8",
	"slave_pending_jobs_size_max": "1073741824",
	"innodb_log_buffer_size":      "16777216",
	"innodb_log_file_size":        "1073741824",
	"innodb_log_files_in_group":   "2",
	"innodb_flush_method":         "O_DIRECT",
	"innodb_use_native_aio":       "1",
	"innodb_autoinc_lock_mode":    "2",
	"performance_schema":          "1",

Describe the solution you'd like

Describe alternatives you've considered

Additional context

runkecheng avatar May 26 '22 08:05 runkecheng

  • How to load custom my.cnf to our cluster

For example:

we have a my.cnf like this

[mysqld]
back_log=-1
big_tables=0
binlog_cache_size=1M
binlog_checksum=NONE
binlog_format=ROW
binlog_row_event_max_size=8192
binlog_row_image=FULL

we can use bellow script to load to our cr:

kubectl patch mysql sample --type=merge --patch "$(jq -sR '{"spec":
            {"mysqlOpts": 
                {"mysqlConf": [split("\n")[:-1][] | split("=") | {(.[0]): .[1]}]| add
                }
            }
        }' < <(grep ^[a-z] my.cnf))"

zhl003 avatar May 27 '22 07:05 zhl003