Skip to content

Commit 7084143

Browse files
authored
Merge pull request #443 from runkecheng/fix_fmt_2.2
Merge pull request #437 from runkecheng/feature_mysql8
2 parents 7f16d54 + 4606843 commit 7084143

File tree

8 files changed

+38
-38
lines changed

8 files changed

+38
-38
lines changed

api/v1alpha1/backup_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type BackupSpec struct {
3131

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

3737
// HostName represents the host for which to take backup

api/v1alpha1/mysqlcluster_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ type MysqlClusterSpec struct {
6565

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

7171
// PVC extra specifiaction.
@@ -199,7 +199,7 @@ type PodPolicy struct {
199199

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

205205
// The busybox image.

config/crd/bases/mysql.radondb.com_backups.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ spec:
4848
description: HostName represents the host for which to take backup
4949
type: string
5050
image:
51-
default: radondb/mysql-sidecar:latest
51+
default: radondb/mysql57-sidecar:v2.2.0
5252
description: To specify the image that will be used for sidecar container.
5353
type: string
5454
required:

config/crd/bases/mysql.radondb.com_mysqlclusters.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ spec:
137137
description: Name for new database to create.
138138
type: string
139139
initTokuDB:
140-
default: true
140+
default: false
141141
description: InitTokuDB represents if install tokudb engine.
142142
type: boolean
143143
mysqlConf:
@@ -252,7 +252,7 @@ spec:
252252
cpu: 10m
253253
memory: 32Mi
254254
imagePullPolicy: IfNotPresent
255-
sidecarImage: radondb/mysql-sidecar:latest
255+
sidecarImage: radondb/mysql57-sidecar:v2.2.0
256256
description: PodPolicy defines the policy to extra specification.
257257
properties:
258258
affinity:
@@ -1182,7 +1182,7 @@ spec:
11821182
schedulerName:
11831183
type: string
11841184
sidecarImage:
1185-
default: radondb/mysql-sidecar:latest
1185+
default: radondb/mysql57-sidecar:v2.2.0
11861186
description: To specify the image that will be used for sidecar
11871187
container.
11881188
type: string

mysqlcluster/syncer/config_map.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func buildMysqlConf(c *mysqlcluster.MysqlCluster) (string, error) {
7777
case "5.7":
7878
addKVConfigsToSection(sec, mysql57Configs)
7979
}
80-
80+
8181
addKVConfigsToSection(sec, mysqlSysConfigs, mysqlCommonConfigs, mysqlStaticConfigs, c.Spec.MysqlOpts.MysqlConf)
8282

8383
if c.Spec.MysqlOpts.InitTokuDB {

mysqlcluster/syncer/mysql_configs.go

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,31 +35,31 @@ var mysqlSysConfigs = map[string]string{
3535
"innodb_open_files": "655360",
3636
"open_files_limit": "655360",
3737

38-
"gtid-mode": "ON",
39-
"enforce-gtid-consistency": "ON",
40-
"slave_parallel_type": "LOGICAL_CLOCK",
41-
"relay_log": "/var/lib/mysql/mysql-relay-bin",
42-
"relay_log_index": "/var/lib/mysql/mysql-relay-bin.index",
43-
"slow_query_log": "1",
44-
"tmp_table_size": "32M",
45-
"tmpdir": "/var/lib/mysql",
38+
"gtid-mode": "ON",
39+
"enforce-gtid-consistency": "ON",
40+
"slave_parallel_type": "LOGICAL_CLOCK",
41+
"relay_log": "/var/lib/mysql/mysql-relay-bin",
42+
"relay_log_index": "/var/lib/mysql/mysql-relay-bin.index",
43+
"slow_query_log": "1",
44+
"tmp_table_size": "32M",
45+
"tmpdir": "/var/lib/mysql",
4646
}
4747

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

5151
"rpl_semi_sync_master_enabled": "OFF",
5252
"rpl_semi_sync_slave_enabled": "ON",
5353
"rpl_semi_sync_master_wait_no_slave": "ON",
5454
"rpl_semi_sync_master_timeout": "1000000000000000000",
5555

56-
"audit_log_file": "/var/log/mysql/mysql-audit.log",
57-
"audit_log_exclude_accounts": "\"root@localhost,root@127.0.0.1," + utils.ReplicationUser + "@%," + utils.MetricsUser + "@%\"",
58-
"audit_log_buffer_size": "16M",
59-
"audit_log_policy": "NONE",
60-
"audit_log_rotate_on_size": "104857600",
61-
"audit_log_rotations": "6",
62-
"audit_log_format": "OLD",
56+
"audit_log_file": "/var/log/mysql/mysql-audit.log",
57+
"audit_log_exclude_accounts": "\"root@localhost,root@127.0.0.1," + utils.ReplicationUser + "@%," + utils.MetricsUser + "@%\"",
58+
"audit_log_buffer_size": "16M",
59+
"audit_log_policy": "NONE",
60+
"audit_log_rotate_on_size": "104857600",
61+
"audit_log_rotations": "6",
62+
"audit_log_format": "OLD",
6363

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

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

77-
"master_info_repository": "TABLE",
78-
"relay_log_info_repository": "TABLE",
79-
"slave_rows_search_algorithms": "INDEX_SCAN,HASH_SCAN",
77+
"master_info_repository": "TABLE",
78+
"relay_log_info_repository": "TABLE",
79+
"slave_rows_search_algorithms": "INDEX_SCAN,HASH_SCAN",
8080
}
8181

8282
var mysql80Configs = map[string]string{
8383
"sql-mode": "STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION," +
84-
"NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY",
84+
"NO_ZERO_DATE,NO_ZERO_IN_DATE,ONLY_FULL_GROUP_BY",
8585
// 7 days = 7 * 24 * 60 * 60
86-
"binlog_expire_logs_seconds": "604800",
86+
"binlog_expire_logs_seconds": "604800",
8787
// use 5.7 auth plugin to be backward compatible
8888
"default-authentication-plugin": "mysql_native_password",
8989
}

sidecar/init.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,12 @@ cp %s %s
285285
cp %s %s
286286
chown -R mysql.mysql %s
287287
chown -R mysql.mysql %s`,
288-
// cp plugin.cnf to /etc/mysql/conf.d/
289-
path.Join(initFilePath, utils.PluginConfigs), path.Join(extraConfPath, utils.PluginConfigs),
290-
// cp extra.cnf to /etc/mysql/conf.d/
291-
path.Join(initFilePath, "extra.cnf"), path.Join(extraConfPath, "extra.cnf"),
292-
// chown -R mysql.mysql plugin.cnf
293-
path.Join(extraConfPath, utils.PluginConfigs),
294-
// chown -R mysql.mysql extra.cnf
295-
path.Join(extraConfPath, "extra.cnf"))
288+
// cp plugin.cnf to /etc/mysql/conf.d/
289+
path.Join(initFilePath, utils.PluginConfigs), path.Join(extraConfPath, utils.PluginConfigs),
290+
// cp extra.cnf to /etc/mysql/conf.d/
291+
path.Join(initFilePath, "extra.cnf"), path.Join(extraConfPath, "extra.cnf"),
292+
// chown -R mysql.mysql plugin.cnf
293+
path.Join(extraConfPath, utils.PluginConfigs),
294+
// chown -R mysql.mysql extra.cnf
295+
path.Join(extraConfPath, "extra.cnf"))
296296
}

utils/constants.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ const (
132132
// LeaderHost is the alias for leader`s host.
133133
LeaderHost = "leader-host"
134134

135-
//
135+
// PluginConfigs is the alias for mysql plugin config.
136136
PluginConfigs = "plugin.cnf"
137137
)
138138

0 commit comments

Comments
 (0)