Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge pull request #437 from runkecheng/feature_mysql8 #443

Merged
merged 1 commit into from
Apr 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/v1alpha1/backup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type BackupSpec struct {

// To specify the image that will be used for sidecar container.
// +optional
// +kubebuilder:default:="radondb/mysql-sidecar:latest"
// +kubebuilder:default:="radondb/mysql57-sidecar:v2.2.0"
Image string `json:"image"`

// HostName represents the host for which to take backup
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/mysqlcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ type MysqlClusterSpec struct {

// PodPolicy defines the policy to extra specification.
// +optional
// +kubebuilder:default:={imagePullPolicy: "IfNotPresent", extraResources: {requests: {cpu: "10m", memory: "32Mi"}}, sidecarImage: "radondb/mysql-sidecar:latest", busyboxImage: "busybox:1.32"}
// +kubebuilder:default:={imagePullPolicy: "IfNotPresent", extraResources: {requests: {cpu: "10m", memory: "32Mi"}}, sidecarImage: "radondb/mysql57-sidecar:v2.2.0", busyboxImage: "busybox:1.32"}
PodPolicy PodPolicy `json:"podPolicy,omitempty"`

// PVC extra specifiaction.
Expand Down Expand Up @@ -199,7 +199,7 @@ type PodPolicy struct {

// To specify the image that will be used for sidecar container.
// +optional
// +kubebuilder:default:="radondb/mysql-sidecar:latest"
// +kubebuilder:default:="radondb/mysql57-sidecar:v2.2.0"
SidecarImage string `json:"sidecarImage,omitempty"`

// The busybox image.
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/mysql.radondb.com_backups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:
description: HostName represents the host for which to take backup
type: string
image:
default: radondb/mysql-sidecar:latest
default: radondb/mysql57-sidecar:v2.2.0
description: To specify the image that will be used for sidecar container.
type: string
required:
Expand Down
6 changes: 3 additions & 3 deletions config/crd/bases/mysql.radondb.com_mysqlclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ spec:
description: Name for new database to create.
type: string
initTokuDB:
default: true
default: false
description: InitTokuDB represents if install tokudb engine.
type: boolean
mysqlConf:
Expand Down Expand Up @@ -252,7 +252,7 @@ spec:
cpu: 10m
memory: 32Mi
imagePullPolicy: IfNotPresent
sidecarImage: radondb/mysql-sidecar:latest
sidecarImage: radondb/mysql57-sidecar:v2.2.0
description: PodPolicy defines the policy to extra specification.
properties:
affinity:
Expand Down Expand Up @@ -1182,7 +1182,7 @@ spec:
schedulerName:
type: string
sidecarImage:
default: radondb/mysql-sidecar:latest
default: radondb/mysql57-sidecar:v2.2.0
description: To specify the image that will be used for sidecar
container.
type: string
Expand Down
2 changes: 1 addition & 1 deletion mysqlcluster/syncer/config_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func buildMysqlConf(c *mysqlcluster.MysqlCluster) (string, error) {
case "5.7":
addKVConfigsToSection(sec, mysql57Configs)
}

addKVConfigsToSection(sec, mysqlSysConfigs, mysqlCommonConfigs, mysqlStaticConfigs, c.Spec.MysqlOpts.MysqlConf)

if c.Spec.MysqlOpts.InitTokuDB {
Expand Down
42 changes: 21 additions & 21 deletions mysqlcluster/syncer/mysql_configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,31 +35,31 @@ var mysqlSysConfigs = map[string]string{
"innodb_open_files": "655360",
"open_files_limit": "655360",

"gtid-mode": "ON",
"enforce-gtid-consistency": "ON",
"slave_parallel_type": "LOGICAL_CLOCK",
"relay_log": "/var/lib/mysql/mysql-relay-bin",
"relay_log_index": "/var/lib/mysql/mysql-relay-bin.index",
"slow_query_log": "1",
"tmp_table_size": "32M",
"tmpdir": "/var/lib/mysql",
"gtid-mode": "ON",
"enforce-gtid-consistency": "ON",
"slave_parallel_type": "LOGICAL_CLOCK",
"relay_log": "/var/lib/mysql/mysql-relay-bin",
"relay_log_index": "/var/lib/mysql/mysql-relay-bin.index",
"slow_query_log": "1",
"tmp_table_size": "32M",
"tmpdir": "/var/lib/mysql",
}

var pluginConfigs = map[string]string{
"plugin-load": "\"semisync_master.so;semisync_slave.so;audit_log.so;connection_control.so\"",
"plugin-load": "\"semisync_master.so;semisync_slave.so;audit_log.so;connection_control.so\"",

"rpl_semi_sync_master_enabled": "OFF",
"rpl_semi_sync_slave_enabled": "ON",
"rpl_semi_sync_master_wait_no_slave": "ON",
"rpl_semi_sync_master_timeout": "1000000000000000000",

"audit_log_file": "/var/log/mysql/mysql-audit.log",
"audit_log_exclude_accounts": "\"root@localhost,[email protected]," + utils.ReplicationUser + "@%," + utils.MetricsUser + "@%\"",
"audit_log_buffer_size": "16M",
"audit_log_policy": "NONE",
"audit_log_rotate_on_size": "104857600",
"audit_log_rotations": "6",
"audit_log_format": "OLD",
"audit_log_file": "/var/log/mysql/mysql-audit.log",
"audit_log_exclude_accounts": "\"root@localhost,[email protected]," + utils.ReplicationUser + "@%," + utils.MetricsUser + "@%\"",
"audit_log_buffer_size": "16M",
"audit_log_policy": "NONE",
"audit_log_rotate_on_size": "104857600",
"audit_log_rotations": "6",
"audit_log_format": "OLD",

"connection_control_failed_connections_threshold": "3",
"connection_control_min_connection_delay": "1000",
Expand All @@ -74,16 +74,16 @@ var mysql57Configs = map[string]string{

"expire-logs-days": "7",

"master_info_repository": "TABLE",
"relay_log_info_repository": "TABLE",
"slave_rows_search_algorithms": "INDEX_SCAN,HASH_SCAN",
"master_info_repository": "TABLE",
"relay_log_info_repository": "TABLE",
"slave_rows_search_algorithms": "INDEX_SCAN,HASH_SCAN",
}

var mysql80Configs = map[string]string{
"sql-mode": "STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION," +
"NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY",
"NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY",
// 7 days = 7 * 24 * 60 * 60
"binlog_expire_logs_seconds": "604800",
"binlog_expire_logs_seconds": "604800",
// use 5.7 auth plugin to be backward compatible
"default-authentication-plugin": "mysql_native_password",
}
Expand Down
16 changes: 8 additions & 8 deletions sidecar/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,12 @@ cp %s %s
cp %s %s
chown -R mysql.mysql %s
chown -R mysql.mysql %s`,
// cp plugin.cnf to /etc/mysql/conf.d/
path.Join(initFilePath, utils.PluginConfigs), path.Join(extraConfPath, utils.PluginConfigs),
// cp extra.cnf to /etc/mysql/conf.d/
path.Join(initFilePath, "extra.cnf"), path.Join(extraConfPath, "extra.cnf"),
// chown -R mysql.mysql plugin.cnf
path.Join(extraConfPath, utils.PluginConfigs),
// chown -R mysql.mysql extra.cnf
path.Join(extraConfPath, "extra.cnf"))
// cp plugin.cnf to /etc/mysql/conf.d/
path.Join(initFilePath, utils.PluginConfigs), path.Join(extraConfPath, utils.PluginConfigs),
// cp extra.cnf to /etc/mysql/conf.d/
path.Join(initFilePath, "extra.cnf"), path.Join(extraConfPath, "extra.cnf"),
// chown -R mysql.mysql plugin.cnf
path.Join(extraConfPath, utils.PluginConfigs),
// chown -R mysql.mysql extra.cnf
path.Join(extraConfPath, "extra.cnf"))
}
2 changes: 1 addition & 1 deletion utils/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const (
// LeaderHost is the alias for leader`s host.
LeaderHost = "leader-host"

//
// PluginConfigs is the alias for mysql plugin config.
PluginConfigs = "plugin.cnf"
)

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.